-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(api_event_errors): error field in APIEvents #2808
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ivor11
changed the title
feat(feat/api_event_errors): init APIEvent struct
feat(feat/api_event_errors): error field in APIEvents
Nov 10, 2023
lsampras
added
A-framework
Area: Framework
C-feature
Category: Feature request or enhancement
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
and removed
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
labels
Nov 10, 2023
lsampras
reviewed
Nov 17, 2023
ivor11
added
S-waiting-on-approval
Status: Review completed, awaiting for approvals from code-owners
and removed
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
labels
Nov 19, 2023
lsampras
approved these changes
Nov 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM...
ivor11
changed the title
feat(feat/api_event_errors): error field in APIEvents
feat(api_event_errors): error field in APIEvents
Nov 20, 2023
harsh-sharma-juspay
approved these changes
Nov 20, 2023
SanchithHegde
removed
the
S-waiting-on-approval
Status: Review completed, awaiting for approvals from code-owners
label
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-framework
Area: Framework
C-feature
Category: Feature request or enhancement
Rust
Pull requests that update Rust code
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Addition of error field to APIEvent struct
Additional Changes
Motivation and Context
Addition of error field to APIEvent struct to log output errors
How did you test it?
run below API twice
2nd request APIEvent response should contain error field with below error
"error\":{\"type\":\"BadRequest\",\"value\":{\"sub_code\":\"HE\",\"error_identifier\":1,\"error_message\":\"The merchant account with the specified details already exists in our records\",\"extra\":null}}
curl --location 'http://localhost:8080/accounts' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: test_admin' \ --data-raw '{ "merchant_id": "ivor_merchant", "locker_id": "m0010", "merchant_name": "NewAge Retailer", "merchant_details": { "primary_contact_person": "John Test", "primary_email": "[email protected]", "primary_phone": "sunt laborum", "secondary_contact_person": "John Test2", "secondary_email": "[email protected]", "secondary_phone": "cillum do dolor id", "website": "www.example.com", "about_business": "Online Retail with a wide selection of organic products for North America", "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US" } }, "return_url": "https://google.com/success", "webhook_details": { "webhook_version": "1.0.1", "webhook_username": "ekart_retail", "webhook_password": "password_ekart@123", "payment_created_enabled": true, "payment_succeeded_enabled": true, "payment_failed_enabled": true }, "routing_algorithm": { "type": "single", "data": "stripe" }, "sub_merchants_enabled": false, "metadata": { "city": "NY", "unit": "245" } }'
grafana link to test
https://grafana.staging.eu.juspay.net/explore?orgId=1&left=%7B%22datasource%22:%22x5WTfCG4k%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bapp%3D%5C%22bach%5C%22%7D%20%7C%3D%20%60ivor_merchant%60%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22x5WTfCG4k%22%7D,%22editorMode%22:%22builder%22%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D
Checklist
cargo +nightly fmt --all
cargo clippy