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

throw StripeError in case handling paymentintent fails #23

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

remonh87
Copy link
Member

@jonasbark would be great if you can check if this is what you want. I also added proper serialisation for the stripe error

@remonh87 remonh87 requested a review from jonasbark April 18, 2021 09:30
@remonh87
Copy link
Member Author

fix #16

});
return PaymentIntent.fromJson(result.unfoldToNonNull());
} on Exception catch (_) {
throw StripeError<PaymentIntentError>(
Copy link
Member

Choose a reason for hiding this comment

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

that way any kind of useful exception information is getting lost I fear

Copy link
Member Author

@remonh87 remonh87 Apr 18, 2021

Choose a reason for hiding this comment

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

Thing is there is no useful exception thrown because everytime stripe throws: promise.reject(RetrievePaymentIntentErrorType.Unknown.toString(), "Retrieving payment intent failed"). I thought at least by this we can make custom error later

@jonasbark
Copy link
Member

I don't think any action here is necessary for #16 as the exception is already thrown as you've mentioned. I just had the misconception that paymentIntentError would be part of the data model that is returned by the native part.
Can you confirm?

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