Closed jasondcater closed 5 years ago
This should probably be fixed at the magma level - why is a raw database error being returned at all?
Does the error return differently in production vs. development mode? Perhaps a development server is exposing an error deliberately?
Do you know what the request is that is being posted to magma?
The query is just a request for data from the database. There is a mismatch between requested attributes and columns in the DB. Magma should definitely be fixed to not emit those error to Timur. Timur should also catch any unexpected output from Magma and filter it to the client. It doens't matter if it's due to the dev/prod mode. One cannot predict 100% of all output from interacting systems. It's best to build in safe guards wherever it's appropriate. In this case is is also appropriate for Timur to be checking the returns from it's various services to make sure they are well formed.
When there is a Magma error on the getDocuments API cycle, Timur will send back the raw error message from Magma. We need to intercept it and send back a user friendly message (and one that doesn't expose the Magma stack).
I got the error when using a mismatch between timur view data and the magma database. Timur was requesting a column/record that didn't exist on my version of magma. Magma complained. The following was sent back to the client.