Respond with descriptive information in consistent JSON on bad requests and server errors

Description

Use JSON to describe explanations of bad requests or server errors.

Need to decide on what structure to use. It might be the same as the one used for 422 validation errors.

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Marc Johnson February 3, 2021 at 12:04 PM

Closing as pre-dates the new decision making process and has not progressed

Heikki Levanto June 13, 2017 at 4:11 PM

I wasn't thinking of any particular error codes. There can be all kind of proxies, load balancers, and firewalls between the client and our server, and each of those can come up with all kind of errors. As long as the client code can somehow handle those, it is OK. It doesn't have to be pretty, but at least the client should not crash and burn - especially if the client is also part of our services.

Marc Johnson June 13, 2017 at 3:39 PM

Good point, I agree that the modules have no control over this and the client needs to be able to handle it.

By bad requests and server errors I was thinking about HTTP responses with a status code within the 400 and 500 ranges respectively. In my mind connection refused is a lower level error (I don't know if the javascript surfaces this differently). Are you referring to the same kind of error?

Heikki Levanto June 13, 2017 at 2:46 PM

Just remember that we can not guarantee that we always return Json structured errors, "connection refused" is a prime example of one where our servers have no control over the message. So the client code must be able to handle plaintext error messages, at least in some way.

Won't Do

Details

Assignee

Reporter

Priority

Development Team

Core: Platform

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created June 13, 2017 at 2:01 PM
Updated February 3, 2021 at 12:17 PM
Resolved February 3, 2021 at 12:04 PM
TestRail: Cases
TestRail: Runs