citeproc-py
citeproc-py copied to clipboard
Exception handling issue
Hi, Thanks for this awesome project.
I am getting following error in my code which is leading to entire formatting to fail.
Traceback (most recent call last):
File "/work/packages/citeproc-py/citeproc/model.py", line 1463, in _is_uncertain_date
circa = item.reference[date_variable].get('circa', False)
AttributeError: 'NoneType' object has no attribute 'get'
I tried following snippet and found that AttributeError is not getting caught as VariableError
class VariableError(Exception):
pass
try:
raise AttributeError("test")
except VariableError:
print("caught VariableError")
except AttributeError:
print("caught AttributeError")
except Exception:
print("caught Exception")
>> caught AttributeError
I intend to raise a pull request handling AttributeError here . Please suggest.