mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 15:34:17 +01:00
fix(api): missing error messages
This commit is contained in:
parent
49d519ddee
commit
bc774d9615
2 changed files with 14 additions and 1 deletions
|
|
@ -132,7 +132,18 @@ class LibraryController(
|
|||
emptyTrashAfterScan = library.emptyTrashAfterScan,
|
||||
seriesCover = library.seriesCover.toDomain(),
|
||||
)
|
||||
libraryLifecycle.updateLibrary(toUpdate)
|
||||
try {
|
||||
libraryLifecycle.updateLibrary(toUpdate)
|
||||
} catch (e: Exception) {
|
||||
when (e) {
|
||||
is FileNotFoundException,
|
||||
is DirectoryNotFoundException,
|
||||
is DuplicateNameException,
|
||||
is PathContainedInPath ->
|
||||
throw ResponseStatusException(HttpStatus.BAD_REQUEST, e.message)
|
||||
else -> throw ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
}
|
||||
}
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ server:
|
|||
servlet.session.timeout: 7d
|
||||
forward-headers-strategy: framework
|
||||
shutdown: graceful
|
||||
error:
|
||||
include-message: always
|
||||
|
||||
management:
|
||||
endpoints.web.exposure.include: "*"
|
||||
|
|
|
|||
Loading…
Reference in a new issue