better exception logging

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

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