librasn / rasn

A Safe #[no_std] ASN.1 Codec Framework
Other
183 stars 43 forks source link

draft: oer: improve error handling of restricted strings #269

Open Nicceboy opened 2 weeks ago

Nicceboy commented 2 weeks ago

Fixes #260

Adds alphabet_name function for StaticPermittedAlphabet trait for better error messages.

Nicceboy commented 2 weeks ago

Actually error reporting isn't that good. Might be better to give the failed value also in the error message like in other codecs

XAMPPRocky commented 2 weeks ago

Actually error reporting isn't that good. Might be better to give the failed value also in the error message like in other codecs

Yes, hough I think it might be good to have a unified error across all codecs for strings, so this logic can be better shared, and if codecs can provide more context they can wrap the error type.

Nicceboy commented 2 weeks ago

Related to this https://github.com/librasn/rasn/issues/185, maybe it can be handled in the same time.