This commit is contained in:
@@ -45,6 +45,10 @@ function dealWithError(msg, vm) {
|
||||
}
|
||||
}
|
||||
vm.formState.appError = msg;
|
||||
|
||||
//TODO: What is this doing exactly?
|
||||
//it's related to server errors but I'm setting appError above
|
||||
//why two error properties?
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
}
|
||||
}
|
||||
@@ -101,12 +105,14 @@ export default {
|
||||
// Localize, log and return error
|
||||
//
|
||||
handleFormError(err, vm) {
|
||||
//called inside forms when things go wrong
|
||||
//called inside forms when things go unexpectedly wrong
|
||||
//returns the localized message in case the form wants to display it as well
|
||||
if (err instanceof Error && err.message) {
|
||||
dealWithError(err.message, vm);
|
||||
} else {
|
||||
dealWithError(err.toString(), vm);
|
||||
//TODO: this is pretty bad
|
||||
var msg = JSON.stringify(err);
|
||||
dealWithError(msg, vm);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user