-
Notifications
You must be signed in to change notification settings - Fork 4
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 errors thrown when parsing filters #49
Conversation
Codecov Report
@@ Coverage Diff @@
## 4-dev #49 +/- ##
==========================================
- Coverage 96.89% 96.76% -0.14%
==========================================
Files 33 34 +1
Lines 967 958 -9
Branches 32 33 +1
==========================================
- Hits 937 927 -10
- Misses 29 30 +1
Partials 1 1
Continue to review full report at Codecov.
|
This pull request fixes 2 alerts when merging ad30a17 into 6ea7509 - view on LGTM.com fixed alerts:
|
Co-authored-by: Adrien Maret <[email protected]>
# [4.0.0](https://github.com/kuzzleio/koncorde/releases/tag/4.0.0) (2021-06-16) #### Breaking changes - [ [#50](#50) ] Rename the maxMinterms configuration ([scottinet](https://github.com/scottinet)) - [ [#45](#45) ] API revision ([scottinet](https://github.com/scottinet)) - [ [#44](#44) ] Make the API synchronous ([scottinet](https://github.com/scottinet)) #### New features - [ [#49](#49) ] Improved errors thrown when parsing filters ([scottinet](https://github.com/scottinet)) - [ [#46](#46) ] Add typescript interfaces ([scottinet](https://github.com/scottinet)) #### Enhancements - [ [#51](#51) ] Hash with SHA256 instead of Murmur3 ([scottinet](https://github.com/scottinet)) #### Optimizations - [ [#47](#47) ] Change range checking library ([scottinet](https://github.com/scottinet)) ---
Description
Errors thrown by Koncorde when it parses filters have useful and descriptive messages for humans, but not so much for developpers trying to handle them efficiently.
This PR brings an overhaul of how Koncorde's filter parser handles errors, with the following improvements:
KoncordeParseError
errors (extending the plainError
class)keyword
property, explaining what keyword caused the errorpath
property, giving the full path of errors, which is useful when dealing with complex filters with a composition ofor
andand
operands"<path>": <message>
. That way, users can easily know where their errors areExample: