Skip to content

Commit

Permalink
better error-logging (to account for err.error maybe not existing).
Browse files Browse the repository at this point in the history
  • Loading branch information
futtta committed Mar 1, 2020
1 parent 373f631 commit 584407b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ function notifySettingsSaved() {
}

function log_error(err) {
jQuery('div.aj_loader').replaceWith("<h2 style='color:red'>Error: " + err.error + "</h2>");
if ( err.error ) {
aj_error = err.error;
} else {
aj_error = JSON.stringify(err);
}
jQuery('div.aj_loader').replaceWith("<h2 style='color:red'>Error: " + aj_error + "</h2>");
}

function aj_step(theStep) {
Expand Down
2 changes: 1 addition & 1 deletion js/admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 584407b

Please sign in to comment.