Skip to content

Commit d4813d5

Browse files
authored
[macros] Update StateError->MacroIntrospectionCycleException. (#3587)
Add a brief note about MacroException.
1 parent 5f60dca commit d4813d5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

working/macros/feature-specification.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,11 @@ returning, meaning it waits for the macro applications on the target type to
592592
finish.
593593

594594
If a cycle arises in macro applications waiting for other macro applications to
595-
complete then a `StateError ` is thrown.
595+
complete then a `MacroIntrospectionCycleException` is thrown.
596596

597597
Subsequent introspection calls on the same target will always throw
598-
`StateError`, even if all macro applications on the target have finished, to
599-
ensure a deterministic outcome.
598+
`MacroIntrospectionCycleException`, even if all macro applications on the
599+
target have finished, to ensure a deterministic outcome.
600600

601601
Rules might be added in future to decide in some specific cases which macro
602602
should run with incomplete introspection results to break a cycle. For example,
@@ -704,6 +704,11 @@ TODO: update this example.
704704

705705
[builder]: https://github.com/dart-lang/sdk/blob/main/pkg/_fe_analyzer_shared/lib/src/macros/api/builders.dart
706706

707+
### Handling Exceptions
708+
709+
All exceptions that the macro APIs might throw are subclasses of
710+
`MacroException`; see the API docs for details.
711+
707712
### Introspection API ordering
708713

709714
Macros may produce code based on the order in which the introspection APIs

0 commit comments

Comments
 (0)