-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Tracking issue: better user facing error reporting #683
Comments
Thanks for this issue, it's really important progress IMO. For now some SDK methods may rely in the error message (e.g. meilisearch/integration-guides#2), so consider that introducing modifications in error messages could imply breaking changes! |
@eskombro, noted! first we'll introduce error code so you can rely on them, then we'll improve the messages ;) |
After some discussions with @Kerollmops, we've decided upon the following error schema:
examples: this leaves us plenty of naming space for errors, and we can still use hexa if we happen to need to more categories. For every error, it should be so that The category I have come up with for now are: There are certainly more of them, input would be appreciated. @eskombro @qdequele @curquiza |
Looks great!
Simple question, creating an index that already exists, or requesting and index which doesn't, for example, are those kind of errors considered as "bad user input"?
Also, I suppose you mean using a generic error message, because no message at all seems very harsh on the user :)
Smart GJ! |
yeah, something like "internal error: EXXXXX". That being said, the server will probably return the error message anyway, but this gives an indication to the front that the message should be ignored. Such errors may also not be thoroughly publicly documented, and a generic documentation will cover them all at once..
this is TBD, and I'd like your input on the matter
Those are state you should not find yourself in, such as nonexistent schema, or things like that. These errors may very well all be private. We can also imagine different level of error reporting depending on who asks, the admin may receive more info than a generic user. The schema allows that. |
I like your suggestion 🙂
It means that, in the future, the error code could be longer, but the
I have no other category in my mind right now... Be sure I'll keep thinking about that.
For me, with the 4 current categories, it would be |
I certainely hope they won't, but this is not what I meant.
exactly |
Okaaay I indeed did not understand well! It's clear now for me! Great then! 🙂 |
After discussions with the team, we decided to change the error code reporting scheme, for a more user friendly one. This is inspired by the way stripe deals with error codes.
We currently have 3 error types:
there are many error codes, each ascociated with an error type, and linking to the documentation with |
Error typesProposition for the
This is for clarity and consistence between the different types.
Important exceptionSpecial case the |
Closed because it is now implemented. |
Introduction
This issue tracks progress being made towards better error reporting.
Currently, when an error occurs, a json object containing a message is sent back to the user, and an HTTP error code is set. The current state of our error reporting is very basic, and our messages tend to lack "user friendliness". With this issue, we'll address this.
Error will be made of 3 parts, described thereafter.
Error codes
Each error that's sent back by the server will be associated with an error code. A nomenclature is TBD, and abstractions on the server-side will enforce this practice. This will allow easier error parsing, by making the error independent from it's message, also resulting in better SDK maintainability.
The error code will be reported thanks to the
errorCode
attribute in the response document.discussions
checklist
Error message
Not much change on this side for now. More effort will be put into this in a later time to provide better error messages (maybe thanks to Anyhow?).
The error message will be reported thanks to the
errorMessage
attribute in the response document.Error links
A link to the documentation will also be returned with the error. It will link to the error page (to be created) to the section corresponding to the error code. This will allow the user to get more information on what failed, and be forwarded the relevant documentation.
A minified link will be provided, in order to remain succinct and readable. It will be in the form:
docs.meilisearch.com/error/$error_code
. Internally, a router redirects this request to the relevant error documentation.The error link will be reported thanks to the
errorLink
attribute in the response document.checklist
The text was updated successfully, but these errors were encountered: