- @ExceptionHandler({CpsException.class})
- public ResponseEntity<Object> handleCpsException(final CpsException exception) {
- return buildErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, exception.getMessage(), extractDetails(exception));
- }
-
- @ExceptionHandler({CpsValidationException.class})
- public ResponseEntity<Object> handleCpsValidationException(final CpsException exception) {
+ @ExceptionHandler({ModelValidationException.class, DataValidationException.class,
+ SchemaSetAlreadyDefinedException.class, AnchorAlreadyDefinedException.class})
+ public static ResponseEntity<Object> handleBadRequestExceptions(final CpsException exception) {