elifesciences / elife-xpub

eLife is an open-access journal and technology provider that publishes promising research in the life and biomedical sciences. This is their implementation of a submission and peer review system based on Coko PubSweet and xPub.
https://elifesciences.org/
MIT License
32 stars 5 forks source link

Surround all database query calls with try catch #2168

Open will-byrne opened 5 years ago

will-byrne commented 5 years ago

Subtasks

note: this should handle emails in the log object as they currently will be logged to a file without being escaped

diversemix commented 5 years ago

We are on the hunt for an error that appears like this in the logs:

{"error":{"message":"undefined passed as argument #1 for 'where' operation. Call skipUndefined() method to ignore the undefined values.","locations":[{"line":2,"column":3}],"path":["submitManuscript"]},"level":"error","message":"undefined passed as argument #1 for 'where' operation. Call skipUndefined() method to ignore the undefined values.","timestamp":"2019-06-21T10:24:34.358Z"}

This is some database failure on the server-side ... we should consider a more graceful client-side response to this as well as the console log fills up with:

app.9413bf0caf83592f91b7.js:formatted:50144 Uncaught (in promise) Error: GraphQL error: undefined passed as argument #1 for 'where' operation. Call skipUndefined() method to ignore the undefined values.