Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve bfx api error handling #298

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Jun 16, 2023

This PR improves BFX API error handling due to the last major changes of the rest-api lib: https://github.com/bitfinexcom/bfx-api-node-rest/blame/master/lib/rest2.js#LL157C14-L170C4


The issue is when we make a call to payInvoiceList endpoint with a user who's NOT_MERCHANT, api send an error in the raw body ERR_INVOICE_LIST: ERR_PAY_USER_NOT_MERCHANT instead of statusText. We should handle this case


Basic changes:

  • Improves bfx api error handling
  • Extends error logging to see bfx api errors

Logging example:
Screenshot from 2023-06-16 11-48-06

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants