Adds album hash not found error handling

This commit is contained in:
aarbit 2024-06-06 00:23:39 -05:00
parent 0c7805eee3
commit bb0cac8553

View File

@ -13,6 +13,13 @@ class GlobalExceptionHandler {
ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(),
e.message ?:""), HttpStatus.INTERNAL_SERVER_ERROR)
}
@ExceptionHandler
fun handleAlbumHashNotFoundException(e: AlbumHashNotFoundException): ResponseEntity<ErrorResponse> {
return ResponseEntity(
ErrorResponse(HttpStatus.BAD_REQUEST.value(),
e.message ?:""), HttpStatus.BAD_REQUEST)
}
@ExceptionHandler
fun handleException(e: RuntimeException): ResponseEntity<ErrorResponse> {
return ResponseEntity(