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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user