Skip to content

fix: improve error message for mismatched section tags#22

Merged
obs-gh-zuozhiwang merged 1 commit intomasterfrom
fix-mismatched-section-error
Apr 6, 2026
Merged

fix: improve error message for mismatched section tags#22
obs-gh-zuozhiwang merged 1 commit intomasterfrom
fix-mismatched-section-error

Conversation

@obs-gh-zuozhiwang
Copy link
Copy Markdown
Collaborator

@obs-gh-zuozhiwang obs-gh-zuozhiwang commented Apr 4, 2026

When a template has mismatched or missing closing section tags, e.g.

{{#alert.severity.isCritical}}.
...
{{/alert.severity.isError}}

currently the parser produced a cryptic error token "t_ident" not found

This PR improves it with a clear message naming the section and its location:
failed to find closing tag for section "alert.severity.isCritical" opened at 1:4

When a template has mismatched or missing closing section tags, the
parser previously produced a cryptic error: `token "t_ident" not found`.
This change replaces it with a clear message that names the section:
`failed to find closing tag for section "X" opened at L:C`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@obs-gh-zuozhiwang obs-gh-zuozhiwang merged commit 2f46567 into master Apr 6, 2026
2 checks passed
@obs-gh-zuozhiwang obs-gh-zuozhiwang deleted the fix-mismatched-section-error branch April 6, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants