|
@@ -30,7 +30,6 @@ public class ExceptionAdvice {
|
|
|
@ExceptionHandler({BadRequestException.class})
|
|
|
public OpenAPIResponse<?> handleBadRequestException(BadRequestException e) {
|
|
|
log.error(Objects.toString(e.getApiRequest()), e);
|
|
|
-
|
|
|
return OpenAPIResponse.<List<? extends GAReportDataDTO>>builder()
|
|
|
.status(APIStatus.BAD_REQUEST)
|
|
|
.message("Invalid request parameters")
|
|
@@ -45,7 +44,20 @@ public class ExceptionAdvice {
|
|
|
@ExceptionHandler({DataException.class})
|
|
|
public OpenAPIResponse<?> handleDataException(DataException e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
+ return OpenAPIResponse.builder()
|
|
|
+ .status(APIStatus.INTERNAL_SERVER_ERROR)
|
|
|
+ .message(e.getMessage())
|
|
|
+ .build();
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * @return 500 INTERNAL_SERVER_ERROR
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
+ @ExceptionHandler({Exception.class, RuntimeException.class})
|
|
|
+ public OpenAPIResponse<?> handleException(Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
return OpenAPIResponse.builder()
|
|
|
.status(APIStatus.INTERNAL_SERVER_ERROR)
|
|
|
.message(e.getMessage())
|