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

Improve "Unexpected input: '{'" error message #4122

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

bentsherman
Copy link
Member

Close #2082 #3325

Some syntax errors in processes and workflows, such as missing/extra commas, are not handled well by the Groovy parser, likely because the custom DSL syntax makes it difficult to determine exactly which token is the cause. As a result, Groovy simply reports the opening brace as the cause: Unexpected input: '{', which causes many users to look for errors before this point, when in reality the error is almost always after it.

Unfortunately, we can't use the DSL to improve this error because it happens during parsing, before our custom AST transforms. The most we can do is to intercept the error and try to provide a hint to the user. The long-term solution is to create a DSL that doesn't require as many syntax transformations.

Try any of the pipeline examples in the liked issues, you will see that the error message now includes an extra note about checking the process/workflow body.

@netlify
Copy link

netlify bot commented Jul 21, 2023

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 548a5d8
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/64ba9edf37a8c900089d8280

@bentsherman bentsherman linked an issue Jul 21, 2023 that may be closed by this pull request
@pditommaso pditommaso merged commit ef9d3cf into master Jul 22, 2023
@pditommaso pditommaso deleted the 2082-better-error-messages branch July 22, 2023 14:28
@pditommaso pditommaso added this to the 23.10.0 milestone Jul 22, 2023
@bentsherman bentsherman linked an issue Jul 24, 2023 that may be closed by this pull request
abhi18av pushed a commit to abhi18av/nextflow that referenced this pull request Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants