razorpay / razorpay-node

Razorpay node.js bindings
MIT License
182 stars 111 forks source link

[bug] A promise was rejected with a non-error #251

Closed adarshmadrecha closed 2 years ago

adarshmadrecha commented 2 years ago

When using Promise based order creation, and if it gives error, Node JS will print a warning in console "a promise was rejected with a non-error".

This is because the object returned in Promise.reject is not instance of Error. The object is a simple JavaScript Object as below

image

ankitdas13 commented 2 years ago

This issue has been fixed and merged in master, therefore i am closing this issue.

@adarshmadrecha Please let us know if you need any help