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

fix(connector): [coinbase][opennode][bitpay] handle error response #1406

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

arvindpatel24
Copy link
Contributor

@arvindpatel24 arvindpatel24 commented Jun 10, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Handle error response correctly for all crypto connectors.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@arvindpatel24 arvindpatel24 added C-bug Category: Bug good first issue Good for newcomers R-waiting-on-L1 Review: Waiting on L1 reviewer labels Jun 10, 2023
@arvindpatel24 arvindpatel24 requested a review from a team as a code owner June 10, 2023 16:46
@arvindpatel24 arvindpatel24 self-assigned this Jun 10, 2023
code: response.code,
message: response.message,
reason: response.reason,
code: response.code.unwrap_or(format!("{}", res.status_code)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
code: response.code.unwrap_or(format!("{}", res.status_code)),
code: response.code.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jagan-jaya jagan-jaya added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Jun 12, 2023
ArjunKarthik
ArjunKarthik previously approved these changes Jun 12, 2023
pub struct OpennodeErrorResponse {
pub status_code: u16,
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously we had template code for ErrorResponse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey yes it was there, but I was not aware of that to change.

@arvindpatel24 arvindpatel24 added S-ready-for-merge and removed R-waiting-on-L1 Review: Waiting on L1 reviewer S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Jun 12, 2023
@jagan-jaya jagan-jaya added this pull request to the merge queue Jun 12, 2023
Merged via the queue into main with commit 301c3dc Jun 12, 2023
6 checks passed
@SanchithHegde SanchithHegde deleted the crypto-errorhandling branch June 13, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants