-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
82fa049
to
74f8935
Compare
b52abe6
to
763ee52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best PR I've seen so far 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you return a content-type: application/json
when returning an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When pushing a badly formatted JSON document (for example the extra coma at the end of the line) I got a bad_request
in v0.20.0 and now an internal
. Can we change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my previous comment: missing primary key has already an error code -> https://docs.meilisearch.com/errors/#missing_primary_key |
@curquiza yeah sorry this part is unrelated to error codes, i just forgot to change the error type for updates 🤦 |
Another feedback. Before there were two errors:
Now, I only get the |
When trying:
I get an internal error, but an error code already exists for this: |
I'm not the one returning this error, milli is, @ManyTheFish @Kerollmops, this one is one you guys ;) @curquiza I think the rest is fixed. |
72e3181
to
e86b47f
Compare
e86b47f
to
9092d35
Compare
When looking for a non-existing update, don't get the same message as before: When doing a search with a bad field name the message also slightly vary:
Transplant:
Feel free to close this comment if this is not an issue! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Checked with @MarinPostma! Issues will be open for the message errors and will be fixed for the v0.21.0 |
bors merge |
Build succeeded: |
This pr implements the error handling for meilisearch.
Rather than grouping errors by types, this implementation groups them by scope, each scope enclosing errors from a scope further down, or new errors within this scope. This makes the tracking of the origins of errors easier , and error handling easier at the module level.
All errors that are eventually returned to the user implement the
Into<ResponseError>
trait.ReponseError
in turn implements theErrorCode
trait frommeilisearch-error
.Some new errors have been introduced with the new engine for which we haven't defined error codes yet. It has been decided with @gmourier that those would return the
internal-error
code until the correct error code is specified.