Add more fields to IonSchemaError
to be used for PartialEq
#141
Labels
enhancement
New feature or request
IonSchemaError
to be used for PartialEq
#141
I'm a little uneasy about having the equality function test only for description string equality, which can be pretty fragile. Developers are likely to write unit tests against a given error string, which means we can't change that error string down the road without also breaking their tests.
We do description string comparisons like this in
ion-rust
'sIonError
type, but the description messages are intentionally terse and do not include lots of contextual information like position. Even there I don't love it.I suppose ideally we'd have fields besides the description that characterized the nature of the failure. For example, a
schema_name
field in eachUnresolvableSchemaError
, or an enum of reasons that anInvalidSchemaError
occurred. Well-defined, tightly-scoped fields that we're comfortable committing to using in ourPartialEq
impl.This doesn't need to block this PR, but we should think it through before 1.0.
Originally posted by @zslayton in #139 (comment)
The text was updated successfully, but these errors were encountered: