Closed agraebe closed 4 years ago
I think we can possibly close this issue.
All sidecar endpoints that result in a non-2xx status code return a json object with an error
property. This is already being used by some consumer projects which do something like:
const result = await fetch(...)
if (!result.ok) {
const error = await result.json();
throw new Error(error);
}
Additionally, I think the core-node proxied endpoints are returning a similar error structure (going off memory since I can't seem to get core-node to error atm). And if we did something like standardize on RFC 7807, we'd wouldn't want to be doing transforms on the proxied endpoints, so we'd probably need to make those changes to the rust codebase as well.
Thoughts?
Agreed
We should ensure that all errors returned by the API follow the same structure and have an appropriate error response code. For the base structure, I'd propose RFC 7807:
We'd need docs URLs for these to work. This will require us to document errors in our docs, which is a great thing I'd argue.