Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved validation error handling #1

Open
anweiss opened this issue Jun 24, 2019 · 6 comments
Open

Improved validation error handling #1

anweiss opened this issue Jun 24, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed parser validation
Milestone

Comments

@anweiss
Copy link
Owner

anweiss commented Jun 24, 2019

All errors are currently Box'ed with little actionable information. The library should provide for better error handling mechanisms for lexing, parsing and validation.

@anweiss anweiss added the enhancement New feature or request label Jun 24, 2019
@anweiss
Copy link
Owner Author

anweiss commented Jul 22, 2019

This has mostly been addressed. Further refinements will be made to the validation error reporting.

@anweiss anweiss closed this as completed Jul 22, 2019
@anweiss anweiss added this to the v1.0.0 milestone Mar 3, 2020
@anweiss
Copy link
Owner Author

anweiss commented Aug 31, 2021

Re-opening as the library could use a re-write of the error handling mechanisms for both parsing and validation. Will likely leverage thiserror.

@anweiss
Copy link
Owner Author

anweiss commented Sep 1, 2021

Decided on https://github.com/yaahc/displaydoc due to its support for no_std.

@anweiss anweiss added the help wanted Extra attention is needed label Sep 13, 2021
@anweiss
Copy link
Owner Author

anweiss commented Apr 15, 2022

@tomachristian would love your input on how I can improve the error handling mechanisms in the validator. Some of this is still dependent on the ratification of JSONPath as a formal standard. It would also be good to get some of the community's input on how CDDL should be traversed for solid error reporting.

CC @cabo for input too

@cabo
Copy link

cabo commented Apr 15, 2022

Which kinds of errors are you looking at?

  • invalid CDDL (parse errors, group/type errors, ...)?
  • validation failures (input does not match CDDL grammar)?

Right now, I'm very interested in the latter.
The obvious implementation of validation leaves you with little clues ("Kernighan's car" -- just like a Prolog program that simply says "no"...).
So how can the information about which paths were taken in a validation be presented?
E.g., if a = b/c/d/e, which of the failures in that choice is the juicy one (or do you report all)?

@anweiss anweiss changed the title Improved error handling Improved validation error handling Apr 15, 2022
@anweiss
Copy link
Owner Author

anweiss commented Apr 15, 2022

Thanks @cabo. Interested in the validation failures specifically. And yea, at the moment, this crate is just presenting all of the failures in the case of type choices where none of the options are valid. It would be good to have some sort of JSONPath-like mechanism for pin-pointing where in the CDDL the validation failure occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed parser validation
Projects
None yet
Development

No branches or pull requests

2 participants