mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02: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,
|
emptyTrashAfterScan = library.emptyTrashAfterScan,
|
||||||
seriesCover = library.seriesCover.toDomain(),
|
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)
|
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ server:
|
||||||
servlet.session.timeout: 7d
|
servlet.session.timeout: 7d
|
||||||
forward-headers-strategy: framework
|
forward-headers-strategy: framework
|
||||||
shutdown: graceful
|
shutdown: graceful
|
||||||
|
error:
|
||||||
|
include-message: always
|
||||||
|
|
||||||
management:
|
management:
|
||||||
endpoints.web.exposure.include: "*"
|
endpoints.web.exposure.include: "*"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue