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

Fix ignored cancel error #1784

Merged
merged 1 commit into from
Jan 1, 2025
Merged

Fix ignored cancel error #1784

merged 1 commit into from
Jan 1, 2025

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Jan 1, 2025

Description

If an invoice cancel fails, we currently only log the error and return undefined and then throw in the constructor of InvoiceCanceledError because invoice is undefined. This results in an uncaught Unhandled Runtime Error.

This change doesn't change that cancel errors result in an unhandled runtime error, but it will at least show the proper error.

According to NextJS docs, these unhandled runtime errors don't show up in prod. I assume they just get logged to console but don't crash the app? Not sure though.

But anyway, so far we never had an invoice cancel fail and this is just about throwing the actual error.

Checklist

Are your changes backwards compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

9. Works on successful cancel. If I throw new Error("test") in the backend, it actually shows me that error in the overlay.

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

@ekzyis ekzyis added the bug label Jan 1, 2025
@huumn huumn merged commit ba2ac2c into master Jan 1, 2025
6 checks passed
@huumn huumn deleted the fix-swallowed-cancel-error branch January 1, 2025 17:18
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.

2 participants