python-intercom
python-intercom copied to clipboard
company_not_found raises an UnexpectedError when it should raise a ResourceNotFound error
We expected company_not_found to raise a ResourceNotFound, but currently it raises an UnexpectedError
We tracked this down to: https://github.com/intercom/python-intercom/blob/master/intercom/errors.py#L68
I think company_not_found just needs to be mapped to ResourceNotFound
from intercom.client import Client
intercom = Client(personal_access_token='YOUR TOKEN')
try:
intercom.companies.find(company_id='does not exist')
except Exception as e:
print(type(e))
<class 'intercom.errors.UnexpectedError'>