Commit a229f113 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed bad error message on API 422 errors.

parent 50a60bbf
......@@ -68,6 +68,9 @@ class ErrorSnacksUnstyled extends React.Component {
errorStr = 'There is a new GUI version available. Please press "shift" and reload the page.'
} else if (error.message.startsWith('could not parse optimade')) {
errorStr = 'The given OPTiMaDe query can not be parsed.'
} else if (error.status === 422) {
errorStr = `Unexpected api error: ${error.apiMessage[0].msg}. Please try again and let us know, if this error keeps happening.`
console.log(error)
} else if (error.message) {
errorStr = `Unexpected error: "${error.message}". Please try again and let us know, if this error keeps happening.`
console.log(error)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment