Replies: 1 comment
|
I think we're in agreement on how to improve error reporting but have held off making major changes to structures until we have API versioning. Once that's in place, we'll be able to iterate without breaking existing clients. There are a lot more improvements we have planned that also require versioning. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I find the error reporting with the API extremely difficult to use. First of all, you still return a 200 response even with an error, but pass an error object back. This is very strange behavior. For most APIs, if there is an error, you are thrown > 400 response. With the Swell API, even if res.ok is true, you then need to check for error objects also meaning that you can never even be sure a 200 response is actually a good response.
Anyway, even with the error returned via 200 response, the errors doesn't make sense. You are returning a errors object with various key values for each error object. This is extremely difficult to work with. Why don't you just send back the errors as an errors Array which is the common technique? The current errors object is formmated in a very strange way, and since it is not an array, you can't loop thru the errors. I guess you need to convert the object to an array based on the keys, but then this is another extra step that should be totally unnecessary if you just sent the errors back in an array.
Just some food for thought. Please improve the error reporting.
All reactions