3c77c86929
Introduce `MacroException` base type that is serializable as a `RemoteInstance`. This means that if a macro implementation does not catch the exception then the exact same instance will be recovered on deserialization. Add `UnexpectedMacroException`, `MacroImplementationException` and `MacroIntrospectionCycleInspection`. Update API docs, analyzer and CFE to throw MacroImplementationException instead of ArgumentError. To do after this PR: update spec, analyzer and tests `StateError`->`MacroIntrospectionCycleInspection`. R=jakemac@google.com Change-Id: I76be4ef7687a5f5611c963be40fb0918ac3fb7ea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347680 Reviewed-by: Jake Macdonald <jakemac@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Morgan :) <davidmorgan@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>