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

Use set_error_handler with late exception #240

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

Slamdunk
Copy link
Collaborator

The @ error control operator still triggers the user error handler, if set, so can't be used.

Still, throwing the exception inside the set_error_handler is a mistake because the consecutive restore_error_handler is never called.

The solution is to:

  1. Set an error handler that only writes down the error message
  2. Restore the error handler
  3. Only then throw the Exception

@Slamdunk Slamdunk added the bug label Oct 12, 2017
@Slamdunk Slamdunk merged commit 09f09ae into ddeboer:v1.0 Oct 12, 2017
@Slamdunk Slamdunk deleted the postponed_error_handler branch October 12, 2017 10:08
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.

1 participant