better exception logging

This commit is contained in:
jonaswinkler committed 2021-02-11 22:16:41 +01:00
1 parent 4211153527
commit ed0b1fe115
5 files changed
+9 -14

No files matched your search

+2 -2
View File
@@ -43,9 +43,9 @@ def load_classifier():
version=version, timeout=86400)
except (EOFError, IncompatibleClassifierVersionError) as e:
# there's something wrong with the model file.
logger.error(
logger.exception(
f"Unrecoverable error while loading document "
f"classification model: {str(e)}, deleting model file."
f"classification model, deleting model file."
)
os.unlink(settings.MODEL_FILE)
classifier = None