Gdal Support mac,linux,win os
This commit is contained in:
@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.client.HttpServerErrorException;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
|
||||
@Slf4j
|
||||
@Order(value = 1)
|
||||
@@ -396,7 +397,8 @@ public class GlobalExceptionHandler {
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ApiResponseDto<String> handlerException(Exception e, HttpServletRequest request) {
|
||||
log.warn("[Exception] resource :{} ", e.getMessage());
|
||||
log.error("[Exception] resource: {}, message: {}", request.getRequestURI(), e.getMessage());
|
||||
log.error("Exception stacktrace: ", e);
|
||||
|
||||
String codeName = "INTERNAL_SERVER_ERROR";
|
||||
ErrorLogEntity errorLog =
|
||||
@@ -504,4 +506,22 @@ public class GlobalExceptionHandler {
|
||||
|
||||
// return new ResponseEntity<>(body, status);
|
||||
}
|
||||
|
||||
@ResponseStatus(HttpStatus.PAYLOAD_TOO_LARGE)
|
||||
@ExceptionHandler(MaxUploadSizeExceededException.class)
|
||||
public ApiResponseDto<String> handleMaxUploadSizeExceeded(
|
||||
MaxUploadSizeExceededException e, HttpServletRequest request) {
|
||||
log.warn("[MaxUploadSizeExceededException] resource :{} ", e.getMessage());
|
||||
ApiResponseCode code = ApiResponseCode.PAYLOAD_TOO_LARGE;
|
||||
ErrorLogEntity errorLog =
|
||||
saveErrorLogData(
|
||||
request,
|
||||
code,
|
||||
HttpStatus.PAYLOAD_TOO_LARGE,
|
||||
ErrorLogDto.LogErrorLevel.WARNING,
|
||||
e.getStackTrace());
|
||||
|
||||
return ApiResponseDto.createException(
|
||||
code, code.getText(), HttpStatus.PAYLOAD_TOO_LARGE, errorLog.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@ public class ApiResponseDto<T> {
|
||||
"You can only reset your password within 24 hours from when the email was sent.\n"
|
||||
+ "To reset your password again, please submit a new request through \"Forgot"
|
||||
+ " Password.\""),
|
||||
PAYLOAD_TOO_LARGE("업로드 용량 제한을 초과했습니다."),
|
||||
;
|
||||
// @formatter:on
|
||||
private final String message;
|
||||
|
||||
Reference in New Issue
Block a user