Skip to content

company_not_found raises an UnexpectedError when it should raise a ResourceNotFound error #222

Open
@hassa

Description

@hassa

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'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions