Skip to content

Conversation

@augustocesarperin
Copy link
Contributor

@augustocesarperin augustocesarperin commented Jan 1, 2026

Addresses error handling issues flagged in the Gemini review of mustache_template.

Changes:

  • Added missing throw before _error() calls in lambda_context.dart
  • Changed Exception to StateError for unreachable code in parser.dart

Fixes flutter/flutter#174938

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses error handling issues by adding missing throw statements in LambdaContext and replacing Exception with the more appropriate StateError for unreachable code in Parser. The changes are correct and improve the code's robustness. I have a few minor suggestions to ensure consistency in error message formatting.

@augustocesarperin augustocesarperin force-pushed the fix-mustache-error-handling branch 3 times, most recently from 6f030ac to 0b77d34 Compare January 1, 2026 07:06
@augustocesarperin augustocesarperin force-pushed the fix-mustache-error-handling branch from 0b77d34 to cd71312 Compare January 1, 2026 08:00
@augustocesarperin augustocesarperin changed the title [mustache_template] Fix error handling issues from Gemini review [mustache_template] Improve error throwing Jan 1, 2026
@bkonyi bkonyi requested a review from stuartmorgan-g January 6, 2026 19:19
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Just changelog nits; thanks for this cleanup!

This could be considered a breaking change, since calls that didn't throw before now do, so we could be conservative and make this a major version change, but since it only affects incorrect usage, and thus hopefully won't affect any actual clients, I think we can treat is as a bugfix. (If that turns out to be incorrect, and a non-trivial number of people are broken by it, we can retract it.)

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 7, 2026
@auto-submit auto-submit bot merged commit 9db114f into flutter:main Jan 7, 2026
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 7, 2026
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jan 7, 2026
flutter/packages@d3f860d...9705815

2026-01-07 47866232+chunhtai@users.noreply.github.com [ci] setup flutter
in batch release workflow (flutter/packages#10735)
2026-01-07 augustocesarperin@gmail.com [mustache_template] Improve error
throwing (flutter/packages#10700)
2026-01-06 47866232+chunhtai@users.noreply.github.com [ci] Adjust
workflow for dispatching go_router batch release
(flutter/packages#10733)
2026-01-06 116356835+AbdeMohlbi@users.noreply.github.com [rfw] Remove
scripting language integration section from `README`
(flutter/packages#10726)
2026-01-06 stuartmorgan@google.com [image_picker] Update for UIScene
compatibility (flutter/packages#10677)
2026-01-06 stuartmorgan@google.com [google_maps_flutter] Add iOS SDK
10.x support (flutter/packages#10720)
2026-01-06 6655696+guidezpl@users.noreply.github.com Update Google Fonts
to v7.0.0 with new and removed fonts (flutter/packages#10713)
2026-01-06 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump the kotlin-gradle-plugin group across 7 directories
with 1 update (flutter/packages#10661)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jan 7, 2026
flutter/packages@d3f860d...9705815

2026-01-07 47866232+chunhtai@users.noreply.github.com [ci] setup flutter
in batch release workflow (flutter/packages#10735)
2026-01-07 augustocesarperin@gmail.com [mustache_template] Improve error
throwing (flutter/packages#10700)
2026-01-06 47866232+chunhtai@users.noreply.github.com [ci] Adjust
workflow for dispatching go_router batch release
(flutter/packages#10733)
2026-01-06 116356835+AbdeMohlbi@users.noreply.github.com [rfw] Remove
scripting language integration section from `README`
(flutter/packages#10726)
2026-01-06 stuartmorgan@google.com [image_picker] Update for UIScene
compatibility (flutter/packages#10677)
2026-01-06 stuartmorgan@google.com [google_maps_flutter] Add iOS SDK
10.x support (flutter/packages#10720)
2026-01-06 6655696+guidezpl@users.noreply.github.com Update Google Fonts
to v7.0.0 with new and removed fonts (flutter/packages#10713)
2026-01-06 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump the kotlin-gradle-plugin group across 7 directories
with 1 update (flutter/packages#10661)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: mustache_template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mustache_template] Improve error throwing

3 participants