Created
June 6, 2022 17:12
-
-
Save artemptushkin/75109f1799fe54ccf504c45fe4d16de8 to your computer and use it in GitHub Desktop.
exception-to-status-map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public Map<Class<? extends Exception>, HttpStatus> exceptionToStatusCode() { | |
return Map.of( | |
CustomExceptionInController.class, HttpStatus.BAD_REQUEST, | |
CustomExceptionInFilter.class, HttpStatus.BAD_REQUEST | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment