diff --git a/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt b/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt index 0a54af8..7420245 100644 --- a/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt +++ b/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt @@ -13,6 +13,13 @@ class GlobalExceptionHandler { ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.message ?:""), HttpStatus.INTERNAL_SERVER_ERROR) } + + @ExceptionHandler + fun handleAlbumHashNotFoundException(e: AlbumHashNotFoundException): ResponseEntity { + return ResponseEntity( + ErrorResponse(HttpStatus.BAD_REQUEST.value(), + e.message ?:""), HttpStatus.BAD_REQUEST) + } @ExceptionHandler fun handleException(e: RuntimeException): ResponseEntity { return ResponseEntity(