Skip to content

Improve error message for invalid config statements#6804

Merged
bentsherman merged 2 commits intomasterfrom
improve-config-invalid-statement-error
Feb 6, 2026
Merged

Improve error message for invalid config statements#6804
bentsherman merged 2 commits intomasterfrom
improve-config-invalid-statement-error

Conversation

@bentsherman
Copy link
Member

A common pattern pre-strict syntax was to mix config statements (assignments, blocks, includes) with imperative statements (if-else, try-catch, etc)

For example:

try {
    includeConfig 'http://example.com/nextflow.config'
}
catch( Exception e ) {
    // ...
}

In the v2 parser, I try to detect these patterns and provide a helpful error message: Try-catch blocks cannot be mixed with config statements, instead of a more cryptic syntax error

However, the above case currently yields Unexpected input: includeConfig. This is because the try block must be parsed as imperative code, which didn't account for using includeConfig as a regular function name.

This PR adds includeConfig as a valid identifier so that a better error message can be given here

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from jorgee February 4, 2026 23:38
@bentsherman bentsherman requested a review from a team as a code owner February 4, 2026 23:38
@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 235e696
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/698621f1169866000884c15a

@bentsherman bentsherman merged commit 4396959 into master Feb 6, 2026
23 checks passed
@bentsherman bentsherman deleted the improve-config-invalid-statement-error branch February 6, 2026 17:27
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