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

Prevent duplicate invocation of the error callback when guarding an instance method #23

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jun 27, 2022

What was happening?

When guarding an instance method that fails using #error, the error callback is invoked twice: once from the call to #error and once when GuardCatcher catches the error to break the flow.

How does this fix it?

Don't invoke callbacks in GuardCatcher if the error was constructed in the same class.

@Drenmi Drenmi merged commit 9743f96 into master Jun 27, 2022
@Drenmi Drenmi deleted the bugfix/duplicate-error-callback branch June 27, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants