Mangopay / mangopay2-nodejs-sdk

Node.js SDK for MANGOPAY
https://www.npmjs.com/package/mangopay2-nodejs-sdk
MIT License
51 stars 38 forks source link

API errors does not reject on 1.42.1 with axios #393

Closed zzzz-ach closed 7 months ago

zzzz-ach commented 7 months ago

On version 1.42.1,

Default error handler in api config only console.log errors and does not reject or resolve anything when functions are called without callbacks. Previous behaviour was promise rejection.

david-kovacs-techmates commented 7 months ago

I'm experiencing the same issue. When awaiting the mangoPayClient.Users.createKycPageFromFile method I cannot handle the errors properly (when the file is missing or is too small), as the success case returns noting as well.

Based on a quick look I think reject(resolveArgument) is missing here. When I added it locally, the await createKycPageFromFile throw an error as expected with the appropriate error message.

https://github.com/Mangopay/mangopay2-nodejs-sdk/blob/c5f2d2e1818f28d3641c52b422f0e228e61e9302/lib/api.js#L215

fredericdelordm commented 7 months ago

Hello @zzzz-ach & @david-kovacs-techmates thanks for the feedback. Just to confirm it will be fixed ASAP.