Provide errors with exact explanation what is wrong.
See original GitHub issueWe need to improve error messages on oxauth. I believe bad examples are in specs directly. Sample from spec:
{
"error":"invalid_request",
"description": "The request is missing a required parameter, includes an unsupported parameter or parameter value, or is otherwise malformed."
}
Is parameter missing? What exactly parameter is missing? Or maybe all are present but some are not supported? Or it is malformed? It is too generic. From beginning we followed spec examples and as for errors it looks very bad. So indeed lets think how to better improve it.
I propose in description provide exact reason. Like
{
"error":"invalid_request",
"description":"redirect_uri parameter is missed."
}
Otherwise if we want to keep it very close to specs examples then we can add “reason” json key:
{
"error":"invalid_request",
"description": "The request is missing a required parameter, includes an unsupported parameter or parameter value, or is otherwise malformed.",
"reason":"redirect_uri parameter is missed."
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Error Messages: Examples, Best Practices & Common Mistakes
4 common mistakes with error messages · 1. Ambiguity · 2. Condescending language/blaming the user · 3. Poor placement of error messages ·...
Read more >Practices of Science: Scientific Error
Error causes results that are inaccurate or misleading and can misrepresent nature. Scientifically accepted values are scientists' current best approximations, ...
Read more >How to Write Good Error Messages - UX Planet
1. Be Clear And Not Ambiguous ... Write error message in clear and simple language. User should be able to understand the problem...
Read more >Experimental Errors - digipac.ca
Experimental Errors. It is impossible to make an exact measurement. Therefore, all experimental results are wrong. Just how wrong they are depends on...
Read more >Errors in Measurement - Math is Fun
Measuring instruments are not exact! Degree of Accuracy. Accuracy depends on the instrument you are measuring with. But as a general rule: The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I like option B adding a reason key in json response.
Most of the errors now have additional
reason
field in error response that provides exact reason of the failure. Some errors are not covered since it requires major code refactoring which is unwanted because it may effect stability (e.g. inner ifs in Authorization Endpoint). We should improve it during other features development and refactor major flow handling. For now considering it as solved.