Proposal - Error types #42
Closed
luismoyano
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
|
@TotalTechGeek Any opinions on this proposal? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @json-logic/core!
This is probably related with #18 and #36
Recently I've been working out on the errors system according to the specifications decided here and found that there's no discussions/concensus yet about which types of errors to expect. Given that the whole point of JSONLogic is to expect same behavior on every language, we also need to deliver the same error types everywhere.
Keep in mind I decided for a new proposal instead of introducing this concern as a comment in #20 because a decision had already been achieved there.
My proposal is inspired on the existing work made in datalogic-rs since there seems to be handlers for every possible scenario around JSONLogic (or at least most of it).
Error values
In order to provide useful contextual information about the errors, it would be great to deliver values about them. I believe the right format would be:
{ type: "Some error", values:[{ name: <value_name:string>, value: <value_content:any> }, #...] }This way, users can traverse a list of values without the need to worry about unexpected or specific key names.
Error types
Would love to read your thoughts. Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions