NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
65 stars 17 forks source link

Error standardization #1144

Open mattdailis opened 10 months ago

mattdailis commented 10 months ago

Across the board, we would like Aerie to return 200 status codes for all requests that don't result in an internal server error.

We want to make sure that the responses are formatted in a way that Hasura understands - we want to eliminate the "message" field was not present error message.

Follow up work would be to make sure that we do not throw internal server errors for situations that a user can fix. This means taking a hard look at all places where we throw new Error(...). A possible outcome might be to replace usages of Error with a subtype of RuntimeException, or (shudder) catch Error in the merlin bindings, which would allow us to cleanly report the error.

camargo commented 10 months ago

For reference, here is where the UI is doing error catching for Hasura requests: https://github.com/NASA-AMMOS/aerie-ui/blob/90d4fe8953d6274a9c85a3a1049ba548f267da18/src/utilities/requests.ts#L77