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

[Discussion] Add the error code & type to the API response #1397

Open
hideokamoto-stripe opened this issue Nov 24, 2022 · 0 comments
Open

[Discussion] Add the error code & type to the API response #1397

hideokamoto-stripe opened this issue Nov 24, 2022 · 0 comments

Comments

@hideokamoto-stripe
Copy link
Contributor

Summary

Add the error code and error type from the Stripe API to the API response.

example:

    return res.status(400).send({
      error: {
        message: e.message,
+       code: e.code,
+       type: e.type,  
      },
    });

Background

Some testing codes are using an error message from the Stripe API.
But when the error message is changed, it will be failed. And we need to update the test code to follow its updates.
example: https://github.com/stripe-samples/accept-a-payment/pull/1382/files

We can reduce these tasks when we use the error code and type instead of the error message.

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

No branches or pull requests

1 participant