Skip to content

Commit

Permalink
refactor utils & change preview
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey committed May 7, 2018
1 parent 404e0d6 commit 6502e42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/utils/errorhandler.js
Expand Up @@ -4,7 +4,12 @@ export const apiErrorHandler = (error) => {
return "Error: Network Error";
} else if (error.response.data) {
const erd = error.response.data;
if (erd.detail) return erd.detail;
if (erd.detail) {
if (erd.detail === "Invalid token.") {
return "Invalid Token. Please re-login.";
}
return erd.detail;
}
if (erd[0]) return erd[0];
const key = Object.keys(erd)[0];
const errorString = erd[key][0];
Expand Down
Binary file modified preview/frontend_5.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6502e42

Please sign in to comment.