From 5cdcb1b7c5acf707ca6111ea5e33f934a4ca674e Mon Sep 17 00:00:00 2001 From: aarbit Date: Fri, 7 Jun 2024 22:52:37 -0500 Subject: [PATCH] Adds support for album folder not found exception handling --- .../prettyplayerapi/exception/GlobalExceptionHandler.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt b/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt index 7420245..fa3499b 100644 --- a/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt +++ b/src/main/kotlin/net/halfbinary/prettyplayerapi/exception/GlobalExceptionHandler.kt @@ -20,6 +20,13 @@ class GlobalExceptionHandler { ErrorResponse(HttpStatus.BAD_REQUEST.value(), e.message ?:""), HttpStatus.BAD_REQUEST) } + + @ExceptionHandler + fun handleAlbumFolderNotFoundException(e: AlbumFolderNotFoundException): ResponseEntity { + return ResponseEntity( + ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), + e.message ?:""), HttpStatus.INTERNAL_SERVER_ERROR) + } @ExceptionHandler fun handleException(e: RuntimeException): ResponseEntity { return ResponseEntity(