Skip to content

Conversation

gregjopa
Copy link
Contributor

This PR adds error handling to the Express routes. I tried to keep the logic simple and just return a 500 status code for any invalid status code returned by the PayPal APIs.

Here are a couple manual tests I did:

  1. Invalid CLIENT_ID/APP_SECRET:

Screen Shot 2022-06-20 at 1 10 42 PM

  1. Invalid amount for create order call:

Screen Shot 2022-06-20 at 1 10 15 PM

@gregjopa gregjopa requested a review from xjamundx June 20, 2022 18:13
Copy link
Contributor

@xjamundx xjamundx 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 thanks

@xjamundx
Copy link
Contributor

Next thing we should add is some tests :D

@xjamundx xjamundx merged commit af0a7ad into main Jun 25, 2022
@gregjopa gregjopa deleted the error_handling branch August 15, 2023 15:46
devapplepaypal pushed a commit to devapplepaypal/docs-examples that referenced this pull request Oct 8, 2024
* updated error handling

---------

Co-authored-by: Sourav Sarkar <soursarkar@paypal.com>
Co-authored-by: Neha Sharma <nsharma20@paypal.com>
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.

2 participants