Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make InvalidGenerationSourceError an Exception (dart-lang/source_gen#687
) See #3585 Rename to `InvalidGenerationSource` and change to a subtype of `Exception`. This class is not thrown to indicate a programming error in the code that is running, it is thrown to indicate an error in the code under analysis. It was originally implemented without a super type and the name ending in "Error" was not specifically discussed, but it was intended to convey an "error in build input", not an error in the builder implementation (where it is thrown). Later a lint required it to be a subtype of either `Error` or `Exception`, and the `Error` supertype was chosen without discussion because of the name, even though it's not thrown as an `Error` in the sense where that distinction matters. Add a type alias for the exception with the old name. This can be deprecated whenever we have the bandwidth to handle the cleanup, but it will not be deprecated immediately. Change from `extends Error` to `implements Exception`. This is technically breaking, but it is unlikely to make a significant impact in real world usage scenarios. It may impact how the error surfaces to end users in some places.
- Loading branch information