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

Add request-specific fields from raw error to top level error #699

Merged
merged 3 commits into from
Oct 8, 2019

Conversation

richardm-stripe
Copy link
Contributor

@richardm-stripe richardm-stripe commented Sep 25, 2019

Per request of @remi-stripe (https://jira.corp.stripe.com/secure/RapidBoard.jspa?rapidView=1346&projectKey=DX&view=planning&selectedIssue=DX-4753&quickFilter=3988)
It is sometimes important to access properties such as error.raw.payment_intent, error.raw.payment_method, etc. But "raw" means "here be dragons, don't rely on anything here". This PR copies these properties from raw to the top level error object, to indicate that they are properly part of our interface and remove the need for users to access "raw".

Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

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

test/Error.spec.js Show resolved Hide resolved
Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

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

lgtm!

@richardm-stripe
Copy link
Contributor Author

Oops, probably should have
cc @stripe/api-libraries

@rattrayalex-stripe
Copy link
Contributor

We should probably document this somewhere. https://github.com/stripe/stripe-node/wiki/Error-Handling at a minimum, perhaps also at stripe.com/docs/api

@richardm-stripe richardm-stripe merged commit f1b2149 into master Oct 8, 2019
@richardm-stripe richardm-stripe deleted the richardm-more-fields-raw-error branch October 8, 2019 15:18
bruun added a commit to bruun/DefinitelyTyped that referenced this pull request Oct 9, 2019
All properties except statusCode were added in version 7.10.0: stripe/stripe-node#699
bruun added a commit to bruun/DefinitelyTyped that referenced this pull request Oct 10, 2019
All properties except statusCode were added in version 7.10.0: stripe/stripe-node#699
andrewbranch pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Oct 14, 2019
* Remove seemingly unintentional property on StripeError

It looks like this was supposed to contain a property name after the readonly keywork, bu instead StripeError now has a property named readonly.

* Add missing properties to StripeError

All properties except statusCode were added in version 7.10.0: stripe/stripe-node#699

* Update stripe version number
chivesrs pushed a commit to chivesrs/DefinitelyTyped that referenced this pull request Nov 19, 2019
* Remove seemingly unintentional property on StripeError

It looks like this was supposed to contain a property name after the readonly keywork, bu instead StripeError now has a property named readonly.

* Add missing properties to StripeError

All properties except statusCode were added in version 7.10.0: stripe/stripe-node#699

* Update stripe version number
nsallerin added a commit to fewlines-education/stripe-demo that referenced this pull request Dec 16, 2019
…ode-dependencies

## Description

**react** and **react-dom** updated from **16.9.0 to 16.12.0**

###### React DOM

* Remove `unstable_createRoot` and `unstable_createSyncRoot` experimental APIs. (These are available in the Experimental channel as `createRoot` and `createSyncRoot`.) ([@acdlite]
* Clear additional fiber fields during unmount to save memory. ([@trueadm](http://github.com/trueadm) in [#16807](facebook/react#16807))
* Prefer `Object.is` instead of inline polyfill, when available. ([@ku8ar](http://github.com/ku8ar) in [#16212](facebook/react#16212))

**react-scripts** updated from **16.9.0 to 16.12.0**

https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md

**dotenv** updated from **8.1.0 to 8.2.0**

https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md
---> no changes in changelog

**stripe** updated from **7.9.1 to 7.14.0**

- [#699](stripe/stripe-node#699) Add request-specific fields from raw error to top level error
- [#719](stripe/stripe-node#719) Define 'type' as a property on errors rather than a getter
- [#728](stripe/stripe-node#728) Remove duplicate export

## Related Issue

[ch1243]

## Motivation and Context

We want our dependencies up to date

## How Has This Been Tested?

Running `yarn test` all tests passed

## Types of changes

- Chore (non-breaking change which refactors / improves the existing code base)
- ~Bug fix (non-breaking change which fixes an issue)~
- ~New feature (non-breaking change which adds functionality)~
- ~Breaking change (fix or feature that would cause existing functionality to 
  change)~

## Checklist:

- ✅ My code follows the code style of this project.
- 🔴 My change requires a change to the documentation.
- 🔴 I have updated the documentation accordingly.
- ✅ I have read the [**CONTRIBUTING**][CONTRIBUTING_FILE] document.
- 🔴 I have added tests to cover my changes.
- ✅ All new and existing tests passed.

[CONTRIBUTING_FILE]: https://github.com/fewlinesco/connect/blob/master/CONTRIBUTING.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants