Commit 5b3e318f authored by Florent Chehab's avatar Florent Chehab

Now catching error 500 in frontend.

Fixes #22
parent ccd63b4c
Pipeline #35794 passed with stages
in 9 minutes and 32 seconds
...@@ -130,11 +130,16 @@ export default class SmartActions { ...@@ -130,11 +130,16 @@ export default class SmartActions {
dispatch(isSavingSpecific(false)); dispatch(isSavingSpecific(false));
}) })
.catch((e) => { .catch((e) => {
if (typeof e.json == "function") { if (typeof e.json === "function") {
return e.json(); return e.json()
.catch((error) => {
// eslint-disable-next-line no-unused-vars
return new Promise((resolve, reject) => resolve(error));
});
} else { } else {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
return new Promise(function (resolve, reject) { resolve(e); }); return new Promise((resolve, reject) => resolve(e));
} }
}) })
.then((errorContent) => { .then((errorContent) => {
......
Markdown is supported
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