Log all errors caught in the frontend at debug level #1618
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to debug my modifications to the frontend, I found that some exceptions are swallowed. This makes it very hard to debug the frontend.
I found that this is due to the way errors are handled in
ThreadedFrontend.cc @mario-bucev and @samuelchassot: this is the problem I had this afternoon.
Background
Callback.failed.onRunmethod.Callback.failedis now a no-op.Current semantic and questions
Frontend.onEndruns even if exceptions are thrown duringFrontend.onRun. Is that excepted? I guess this might be to allowFrontend.onEndto recover from some errors?If an exception is thrown in
Frontend.onEnd, it swallows any exception thrown inFrontend.onRun. Here is a minimal reproduction:Is this expected? I think the first exception should at least be logged in debug mode. Should it also be rethrown?
The first exception which is not
UnsupportedCodeExceptionthrown duringFrontend.onEnd, or duringFrontend.onRunis rethrown without being reported as an error, it is only logged at the debug level. Why areUnsupportedCodeExceptions handled differently?UnsupportedCodeExceptionwhich are thrown before the first non-UnsupportedCodeExceptionexception are reported as errors. The others are ignored. This seems weird. Seedef rethrow.Proposed changes
This PR enables logging all exceptions thrown in the frontend, at debug level.
It doesn't make any other changes. In particular, the semantic described above is preserved.
Depending on the answers to my questions above, further changes might be needed.