robertodoering/twitter_api

Error Instance of 'Response'

Closed this issue · 3 comments

Hi, when I try your documentation about uploading image, it comes to error like this :

image

How can I fix this ? thankyou

When I debug your code, resulting {"errors":[{"code":89,"message":"Invalid or expired token."}]}
but if I try using postman, its works

image

wow its my fault, im sorry i forgot to check token

But, you can give us better error handling message instead of Instance of 'Response'

All errors returned by twitter will be a response. The message is not parsed by this package at the moment.
Here is a comment from the example:

// Requests made by the client can throw the following errors:
//
// * `TimeoutException` when a request hasn't returned a response for some
//   time (defaults to 10s, can be changed in the TwitterClient).
//
// * `Response` when the received response does not have a 2xx status code.
//   Most responses include additional error information that can be parsed
//   manually from the response's body.
//
// * Other unexpected errors in unlikely events (for example when parsing
//   the response).