PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.28k stars 176 forks source link

[bug] `error` does not exist on type `TwitterApiErrorData` #521

Open timb-103 opened 6 months ago

timb-103 commented 6 months ago

When we get the error of uploading an image greater than 5MB, we get a 400 error but it doesn't contain the standard error structure in your library, instead it has a data.error that includes a message similar to "The image is greater than 5MB".

Is this a new response, or how can we map it into your error handling? It doesn't have a type either so it's throwing a ts error. Property 'error' does not exist on type 'TwitterApiErrorData'. Did you mean 'errors'?