-
Notifications
You must be signed in to change notification settings - Fork 463
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
stripe.Error does not work with errors.As() #1260
Comments
The docs for var stripeErr *stripe.Error |
Right, because that Error method actually takes |
nadaismail-stripe
added a commit
that referenced
this issue
Oct 18, 2024
* Temp commit * Temp checkin to switch tracks * We appear to be ready for config import but need another first-install run. * add import modal * Remove changes for actual config importer to limit scope to just the config manager * Working to improve test coverage * got test coverage up to 83 percent * Initial commit with new API methods * Trivial changes for delete account config * Adding get all account configs api method * Intermediate commit * More changes to bring implementation closer to doc * Update tooling to help find the issue * bad import statements * Init commit of using new composite key * More refactors * Migration to add default field to users * Fix so that we budget for multiple returns, as sf acct id isn't a key anymore * Just the migration script * init commit custom field * Rename Stripe_Account_ID__C.field-meta.xml to Stripe_Account_ID__c.field-meta.xml * Changing label and adding to Order information * Changing text field to more complex structure, not showing up in the UI * Reworking a bit, testing out deploys * Fixing feedback * [Multi Stripe Account] Modifying order poller (#1251) * Adding a simple statement to the soql query * Adding constant and using prefixed stripe field * Update stripe_callback_handler to handle adding stripe accounts, and add provisional v2 connection statuses endpoint * additional pieces needed for other updates * Remove magic strings * Added livemode to response key for status endpoint * got initial connection loop working w/ minor bug to fix later * Adding livemode fields to permission set, modifying order poller, adding constants * Made things work, minimally * Completed essential work for multi-stripe account support * Improved test coverage: Org Wide Coverage 84% * Account poller only polls the default user * Fix missed debug enabling * Add description for stripe id * Added description to stripe account field on order. * Button up multi-stripe account support * Couple tweaks * Added some nice git ignores * Added more instructions to local dev testing * bug bash fixes (#1265) * bug bash fixes * Added comments and soft delete instead of hard deleting users * More pr feedback * UI changes from bug bash * Fix a bug rish was encountering * Removed refs to connection status * Added a comment * Nada pr feedback * Removing bad test --------- Co-authored-by: Keshav Chakrapani <[email protected]> Co-authored-by: keshavc-stripe <[email protected]> Co-authored-by: Nada Ismail <[email protected]>
nadaismail-stripe
added a commit
that referenced
this issue
Oct 18, 2024
nadaismail-stripe
added a commit
that referenced
this issue
Oct 18, 2024
* multi stripe account support (#1260) * Temp commit * Temp checkin to switch tracks * We appear to be ready for config import but need another first-install run. * add import modal * Remove changes for actual config importer to limit scope to just the config manager * Working to improve test coverage * got test coverage up to 83 percent * Initial commit with new API methods * Trivial changes for delete account config * Adding get all account configs api method * Intermediate commit * More changes to bring implementation closer to doc * Update tooling to help find the issue * bad import statements * Init commit of using new composite key * More refactors * Migration to add default field to users * Fix so that we budget for multiple returns, as sf acct id isn't a key anymore * Just the migration script * init commit custom field * Rename Stripe_Account_ID__C.field-meta.xml to Stripe_Account_ID__c.field-meta.xml * Changing label and adding to Order information * Changing text field to more complex structure, not showing up in the UI * Reworking a bit, testing out deploys * Fixing feedback * [Multi Stripe Account] Modifying order poller (#1251) * Adding a simple statement to the soql query * Adding constant and using prefixed stripe field * Update stripe_callback_handler to handle adding stripe accounts, and add provisional v2 connection statuses endpoint * additional pieces needed for other updates * Remove magic strings * Added livemode to response key for status endpoint * got initial connection loop working w/ minor bug to fix later * Adding livemode fields to permission set, modifying order poller, adding constants * Made things work, minimally * Completed essential work for multi-stripe account support * Improved test coverage: Org Wide Coverage 84% * Account poller only polls the default user * Fix missed debug enabling * Add description for stripe id * Added description to stripe account field on order. * Button up multi-stripe account support * Couple tweaks * Added some nice git ignores * Added more instructions to local dev testing * bug bash fixes (#1265) * bug bash fixes * Added comments and soft delete instead of hard deleting users * More pr feedback * UI changes from bug bash * Fix a bug rish was encountering * Removed refs to connection status * Added a comment * Nada pr feedback * Removing bad test --------- Co-authored-by: Keshav Chakrapani <[email protected]> Co-authored-by: keshavc-stripe <[email protected]> Co-authored-by: Nada Ismail <[email protected]> * Fixing the multi stripe account bug * Fixing rubocop error --------- Co-authored-by: jmather-c <[email protected]> Co-authored-by: Nada Ismail <[email protected]>
nadaismail-stripe
added a commit
that referenced
this issue
Oct 18, 2024
* multi stripe account support (#1260) * Temp commit * Temp checkin to switch tracks * We appear to be ready for config import but need another first-install run. * add import modal * Remove changes for actual config importer to limit scope to just the config manager * Working to improve test coverage * got test coverage up to 83 percent * Initial commit with new API methods * Trivial changes for delete account config * Adding get all account configs api method * Intermediate commit * More changes to bring implementation closer to doc * Update tooling to help find the issue * bad import statements * Init commit of using new composite key * More refactors * Migration to add default field to users * Fix so that we budget for multiple returns, as sf acct id isn't a key anymore * Just the migration script * init commit custom field * Rename Stripe_Account_ID__C.field-meta.xml to Stripe_Account_ID__c.field-meta.xml * Changing label and adding to Order information * Changing text field to more complex structure, not showing up in the UI * Reworking a bit, testing out deploys * Fixing feedback * [Multi Stripe Account] Modifying order poller (#1251) * Adding a simple statement to the soql query * Adding constant and using prefixed stripe field * Update stripe_callback_handler to handle adding stripe accounts, and add provisional v2 connection statuses endpoint * additional pieces needed for other updates * Remove magic strings * Added livemode to response key for status endpoint * got initial connection loop working w/ minor bug to fix later * Adding livemode fields to permission set, modifying order poller, adding constants * Made things work, minimally * Completed essential work for multi-stripe account support * Improved test coverage: Org Wide Coverage 84% * Account poller only polls the default user * Fix missed debug enabling * Add description for stripe id * Added description to stripe account field on order. * Button up multi-stripe account support * Couple tweaks * Added some nice git ignores * Added more instructions to local dev testing * bug bash fixes (#1265) * bug bash fixes * Added comments and soft delete instead of hard deleting users * More pr feedback * UI changes from bug bash * Fix a bug rish was encountering * Removed refs to connection status * Added a comment * Nada pr feedback * Removing bad test --------- Co-authored-by: Keshav Chakrapani <[email protected]> Co-authored-by: keshavc-stripe <[email protected]> Co-authored-by: Nada Ismail <[email protected]> * Fixing the multi stripe account bug * Correcting pr feedback * Adding new script to populate stripe account objects * Fix merge conflicts and remove create stripe account script * Delete dead ruby code * Removing comments from order_poller * Change some of the UI * Refactor stripe callback handler * Rename * Remove doubled lined * Add back state * Fix type errors * Fix livemode error * Fix errors * Add comment * Add error * Fixing reauth bug * typecheck * Update livemode * Set livemode on state * Convert to string * Set livemode * Revert v2 error * Revert or false * Fixing bugs with refactor * Changing comments to be more accurate --------- Co-authored-by: jmather-c <[email protected]> Co-authored-by: Nada Ismail <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I have a
shop
package with a Client type that wraps a Stripe client in a focused, higher-level interface. I am adding support for coupon codes and need to check if the error I get from Stripe means "that coupon code is invalid" or something else.I have this
but I get this warning in my editor, and executing this code results in a panic
Which is weird, as in the docs I clearly see that
stripe.Error
implements theerror
interface. I'm not sure if this is a bug in stripe-go package, the built-in errors package, or maybe I'm too tired to think. By the way, is this the correct way for checking for such an error? Please advise 🙂Additional note: I can't just do a type assertion, because my
shop.Client
wraps the error withfmt.Errorf
. For now I will just type-assertUnwrap()
pable interface, and then type-assertstripe.Error
the inner error.My environment:
The text was updated successfully, but these errors were encountered: