bookwyrm/bookwyrm/utils/log.py
2022-06-05 13:41:00 -07:00

13 lines
381 B
Python

import logging
class IgnoreVariableDoesNotExist(logging.Filter):
def filter(self, record):
if record.exc_info:
(errType, errValue, _) = record.exc_info
while errValue:
if type(errValue).__name__ == "VariableDoesNotExist":
return False
errValue = errValue.__context__
return True