intercom / python-intercom

Python wrapper for the Intercom API.
https://keyes.ie/things/python-intercom/
Other
234 stars 145 forks source link

The error of type 'None' is not recognized. #161

Open lukas-gitl opened 7 years ago

lukas-gitl commented 7 years ago

The error of type 'None' is not recognized. It occurred with the message: Server Error and http_code: '500'. Please contact Intercom with these details. message: The error of type 'None' is not recognized. It occurred with the message: Server Error and http_code: '500'. Please contact Intercom with these details. context: {'http_code': 500, 'application_error_code': u'server_error'} Traceback (most recent call last): ... File "/usr/local/lib/python2.7/site-packages/intercom/api_operations/save.py", line 14, in create response = self.client.post("/%s/" % (collection), params) File "/usr/local/lib/python2.7/site-packages/intercom/client.py", line 96, in post return self._execute_request(req, params) File "/usr/local/lib/python2.7/site-packages/intercom/client.py", line 84, in _execute_request result = request.execute(self.base_url, self._auth, params) File "/usr/local/lib/python2.7/site-packages/intercom/request.py", line 36, in execute return self.send_request_to_path(base_url, auth, params) File "/usr/local/lib/python2.7/site-packages/intercom/request.py", line 84, in send_request_to_path parsed_body = self.parse_body(resp) File "/usr/local/lib/python2.7/site-packages/intercom/request.py", line 98, in parse_body self.raise_application_errors_on_failure(body, resp.status_code) # noqa File "/usr/local/lib/python2.7/site-packages/intercom/request.py", line 154, in raise_application_errors_on_failure raise error_class(message, error_context) UnexpectedError: The error of type 'None' is not recognized. It occurred with the message: Server Error and http_code: '500'. Please contact Intercom with these details.

sir-dunxalot commented 7 years ago

I also have this error with the following code:

from intercom.client import Client
access_token = '<my_access_token>'
return Client(personal_access_token = access_token)
kerrermanisNL commented 6 years ago

Having difficulties with this too, mainly when trying to update a user and it's company. I get the following:

The error of type 'None' is not recognized. It occurred with the message: Company already exists. and http_code: '400'. Please contact Intercom with these details.

Tried doing this manually with curl, and that succeeded. So something is going wrong here I believe. Note that this is an UnexpectedError.

jkeyes commented 6 years ago

@lukas-gitl Can you remember how that error was generated? A 500 response indicates an issue on the API side of things.

jkeyes commented 6 years ago

@sir-dunxalot Do you still have the issue?

jkeyes commented 6 years ago

@kerrermanisNL That looks like a different issue. Can you raise a new issue and supply some sample code that exhibits the behaviour. Thanks.

lukas-gitl commented 6 years ago

@jkeyes Probably. We just stopped caring about errors and just retry and retry and retry and retry ... and eventually let it fail. But usually it eventually succeeds ;)

sir-dunxalot commented 6 years ago

@jkeyes Have not used this library recently (because I haven't needed Intercom), sorry.