mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-15 10:13:15 -05:00
catch another exception regarding classifier loading
This commit is contained in:
parent
3b73146ecd
commit
ca1e838c52
@ -34,7 +34,9 @@ def load_classifier():
|
|||||||
try:
|
try:
|
||||||
classifier.load()
|
classifier.load()
|
||||||
|
|
||||||
except (EOFError, IncompatibleClassifierVersionError) as e:
|
except (EOFError,
|
||||||
|
IncompatibleClassifierVersionError,
|
||||||
|
pickle.UnpicklingError):
|
||||||
# there's something wrong with the model file.
|
# there's something wrong with the model file.
|
||||||
logger.exception(
|
logger.exception(
|
||||||
f"Unrecoverable error while loading document "
|
f"Unrecoverable error while loading document "
|
||||||
@ -42,9 +44,9 @@ def load_classifier():
|
|||||||
)
|
)
|
||||||
os.unlink(settings.MODEL_FILE)
|
os.unlink(settings.MODEL_FILE)
|
||||||
classifier = None
|
classifier = None
|
||||||
except OSError as e:
|
except OSError:
|
||||||
logger.error(
|
logger.exception(
|
||||||
f"Error while loading document classification model: {str(e)}"
|
f"Error while loading document classification model"
|
||||||
)
|
)
|
||||||
classifier = None
|
classifier = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user