Skip to content

Improve unknown annotation trait errors#644

Merged
mtdowling merged 1 commit intomasterfrom
improve-unknown-annotation-trait-errors
Dec 1, 2020
Merged

Improve unknown annotation trait errors#644
mtdowling merged 1 commit intomasterfrom
improve-unknown-annotation-trait-errors

Conversation

@mtdowling
Copy link
Copy Markdown
Member

When an annotation trait isn't defined in the model but SPI can be found
for it, the error message is about providing a null value for an
AnnotationTrait when an object is expected, and that's confusing. This
change addresses this by assuming that an unknown annotation trait is an
object since that is the most common case (and because annotation traits can
never be null). This doesn't end up resulting in a clean model validation
result, but it gives better error messages about the trait not being defined.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When an annotation trait isn't defined in the model but SPI can be found
for it, the error message is about providing a null value for an
AnnotationTrait when an object is expected, and that's confusing. This
change addresses this by assuming that an unknown annotation trait is an
object since that is the most common case (and because annotation traits can
never be null). This doesn't end up resulting in a clean model validation
result, but it gives better error messages about the trait not being defined.
@mtdowling mtdowling merged commit 6d60e86 into master Dec 1, 2020
@mtdowling mtdowling deleted the improve-unknown-annotation-trait-errors branch December 11, 2020 17:58
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