mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 07:23:34 +01:00
fix: use more specific error code when file is not found during analysis
This commit is contained in:
parent
32f4d7f651
commit
ebfc5e1376
1 changed files with 4 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import org.gotson.komga.infrastructure.mediacontainer.ContentDetector
|
|||
import org.gotson.komga.infrastructure.mediacontainer.MediaContainerExtractor
|
||||
import org.springframework.stereotype.Service
|
||||
import java.nio.file.AccessDeniedException
|
||||
import java.nio.file.NoSuchFileException
|
||||
|
||||
private val logger = KotlinLogging.logger {}
|
||||
|
||||
|
|
@ -75,6 +76,9 @@ class BookAnalyzer(
|
|||
} catch (ade: AccessDeniedException) {
|
||||
logger.error(ade) { "Error while analyzing book: $book" }
|
||||
return Media(status = Media.Status.ERROR, comment = "ERR_1000", bookId = book.id)
|
||||
} catch (ex: NoSuchFileException) {
|
||||
logger.error(ex) { "Error while analyzing book: $book" }
|
||||
return Media(status = Media.Status.ERROR, comment = "ERR_1018", bookId = book.id)
|
||||
} catch (ex: Exception) {
|
||||
logger.error(ex) { "Error while analyzing book: $book" }
|
||||
return Media(status = Media.Status.ERROR, comment = "ERR_1005", bookId = book.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue