This commit is contained in:
2020-06-21 23:56:43 +00:00
parent c42e3837be
commit 2e6f00e824
2 changed files with 10 additions and 2 deletions

View File

@@ -490,6 +490,8 @@ export default {
///////////////////////////////
// SERVER ERRORS
// Process and return server errors if any for form and field specified
// note that this is called in turn by every control on the form so it's only job
// is to return errors if they exist for *that* field
//
serverErrors(vm, ref) {
//CHECK PREREQUISITES IN DEV MODE TO ENSURE FORM ISN"T MISSING NEEDED DATA ATTRIBUTES ETC
@@ -545,8 +547,9 @@ export default {
//GENERAL ERROR
if (ref == "errorbox") {
//Add any general errors to ret
//Add any general errors to ret (specific detail errors for the errorbox will be processed later below)
let err = vm.$ay.t("ErrorAPI" + apiErrorCode.toString());
if (vm.formState.serverError.message) {
err = err + "\r\n" + vm.formState.serverError.message;
}
@@ -558,13 +561,13 @@ export default {
});
ret.push(err);
}
//DETAIL ERRORS
//{"error":{"code":"2200","details":[{"message":"Exception: Error converting value \"\" to type 'AyaNova.Biz.AUTHORIZATION_ROLES'. Path 'roles', line 1, position 141.","target":"roles","error":"2203"}],"message":"Object did not pass validation"}}
//Specific field validation errors are in an array in "details" key
if (!window.$gz._.isEmpty(vm.formState.serverError.details)) {
//See if this key is in the details array
let errorsForField = getErrorsForField(vm, ref);
if (errorsForField.length > 0) {
//iterate the errorsForField object and add each to return array of errors
window.$gz._.each(errorsForField, function(ve) {
@@ -576,6 +579,9 @@ export default {
ve.error +
"]";
if (ve.message) {
if (ve.message.includes("LT:")) {
ve.message = vm.$ay.t(ve.message.split(":")[1]);
}
fldErr += ' - "' + ve.message + '"';
}
ret.push(fldErr);

View File

@@ -145,6 +145,8 @@ export default {
"ErrorUserNotAuthorized",
"ErrorNoMatch",
"ErrorPickListQueryInvalid",
"ErrorSecurityUserCapacity",
"ErrorDBForeignKeyViolation",
"DeletePrompt",
"AreYouSureUnsavedChanges",
"Leave",