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

Add descriptive message for unexpected DSL exceptions #913

Merged
merged 1 commit into from Apr 29, 2022

Conversation

paracycle
Copy link
Member

Motivation

Currently, when a DSL compiler raises an error while running a decorate operation, it is not very obvious which compiler failed and during the processing of which constant. The failing DSL compiler is kind of obvious if one looks at the backtrace, but the constant that it is failing on is very hard to understand if one is not running DSL generation in verbose mode.

Implementation

This PR handles unexpected exceptions, shows a friendly error message for them and re-raises the exception to keep the current behaviour.

Tests

Added a test with a failing DSL compiler.

@paracycle paracycle added the enhancement New feature or request label Apr 29, 2022
@paracycle paracycle requested a review from a team April 29, 2022 13:00
@paracycle paracycle self-assigned this Apr 29, 2022
Copy link
Contributor

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Currently, when a DSL compiler raises an error while running a `decorate`
operation, it is not very obvious which compiler failed and during the
processing of which constant. The failing DSL compiler is kind of obvious
if one looks at the backtrace, but the constant that it is failing on
is very hard to understand if one is not running DSL generation in verbose
mode.

This PR handles unexpected exceptions, shows a friendly error message for
them and re-raises the exception to keep the current behaviour.
@paracycle paracycle merged commit 03619fb into main Apr 29, 2022
@paracycle paracycle deleted the uk-better-exceptions branch April 29, 2022 14:21
@AntoineToussaint
Copy link

Best PR ever!

@shopify-shipit shopify-shipit bot temporarily deployed to production May 13, 2022 23:08 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to 0-8-stable May 30, 2022 13:45 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants