User lists now working properly with datalist. Fixup for many areas where error constructor was being called with object instead of string
This commit is contained in:
@@ -204,7 +204,8 @@ export default {
|
||||
//call seed route
|
||||
let jobId = await window.$gz.api.upsert("attachment/maintenance");
|
||||
if (jobId.error) {
|
||||
throw new Error(jobId.error);
|
||||
//throw new Error(jobId.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
|
||||
}
|
||||
jobId = jobId.jobId; //it's in a sub key
|
||||
vm.jobActive = true;
|
||||
@@ -230,7 +231,10 @@ export default {
|
||||
`job-operations/status/${jobId}`
|
||||
);
|
||||
if (jobStatus.error) {
|
||||
throw new Error(jobStatus.error);
|
||||
// throw new Error(jobStatus.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
||||
);
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
if (jobStatus == 4 || jobStatus == 0) {
|
||||
|
||||
@@ -388,11 +388,13 @@ export default {
|
||||
//send request
|
||||
r = await window.$gz.api.upsert("license/trialRequest", vm.request);
|
||||
if (r.error) {
|
||||
throw new Error(r);
|
||||
//throw new Error(r);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(r, vm));
|
||||
}
|
||||
//a string is returned and will start with E1 if it's an error
|
||||
if (r.startsWith("E1")) {
|
||||
throw new Error(r);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(r, vm));
|
||||
//throw new Error(r);
|
||||
}
|
||||
|
||||
if (r == "ok") {
|
||||
@@ -414,7 +416,10 @@ export default {
|
||||
//It might have been just installed by the server on it's own so check if we are not working with the most current license
|
||||
let currentServerLicenseInfo = await window.$gz.api.get("license");
|
||||
if (currentServerLicenseInfo.error) {
|
||||
throw new Error(currentServerLicenseInfo.error);
|
||||
//throw new Error(currentServerLicenseInfo.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(currentServerLicenseInfo, vm)
|
||||
);
|
||||
}
|
||||
currentServerLicenseInfo = currentServerLicenseInfo.data.license;
|
||||
|
||||
@@ -433,11 +438,13 @@ export default {
|
||||
let r = await window.$gz.api.upsert("license");
|
||||
//r should just be a string response unless there is an error in which case it's an object
|
||||
if (r.error) {
|
||||
throw new Error(r);
|
||||
// throw new Error(r);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(r, vm));
|
||||
}
|
||||
|
||||
if (r.startsWith("E1")) {
|
||||
throw new Error(r);
|
||||
//throw new Error(r);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(r, vm));
|
||||
}
|
||||
//If here, there is no technical error
|
||||
//key might not exist or be not found but no error so r contains the deets
|
||||
@@ -590,7 +597,6 @@ async function initForm(vm) {
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
return Promise.reject(res);
|
||||
//throw new Error(res);
|
||||
}
|
||||
vm.currentLicenseInfo = res.data.license;
|
||||
|
||||
@@ -598,7 +604,6 @@ async function initForm(vm) {
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
return Promise.reject(res);
|
||||
//throw new Error(res);
|
||||
}
|
||||
vm.dbIsEmpty = res.data;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,6 @@ async function getServerInfo(vm) {
|
||||
let res = await window.$gz.api.get("server-info");
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
//throw new Error(res);
|
||||
return Promise.reject(res);
|
||||
} else {
|
||||
vm.serverInfo = res.data;
|
||||
|
||||
@@ -377,7 +377,8 @@ async function initDataObject(vm) {
|
||||
let url = "form-field-definition/" + vm.$route.params.formCustomTemplateKey;
|
||||
let res = await window.$gz.api.get(url);
|
||||
if (res.error) {
|
||||
throw new Error(res.error);
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
}
|
||||
//set vm.obj to the combined synthesized snapshot array of template and availble fields for working data for this form
|
||||
// - {key, ltdisplay, hideable, custom, required, hide, type}
|
||||
|
||||
@@ -1203,7 +1203,8 @@ async function populateFieldDefinitions(vm) {
|
||||
"data-list/listfields?DataListKey=" + vm.dataListKey
|
||||
);
|
||||
if (res.error) {
|
||||
throw new Error(res.error);
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.fieldDefinitions = res.data;
|
||||
}
|
||||
@@ -1259,7 +1260,8 @@ async function setEffectiveListView(vm) {
|
||||
);
|
||||
|
||||
if (res.error) {
|
||||
throw new Error(res.error);
|
||||
// throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.effectiveListView = JSON.parse(res.data);
|
||||
vm.obj.name = vm.$ay.t("FilterUnsaved");
|
||||
@@ -1268,7 +1270,8 @@ async function setEffectiveListView(vm) {
|
||||
//listview has an id value
|
||||
let res = await window.$gz.api.get("data-list-view/" + vm.listViewId);
|
||||
if (res.error) {
|
||||
throw new Error(res.error);
|
||||
//throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
} else {
|
||||
vm.effectiveListView = JSON.parse(res.data.listView);
|
||||
vm.obj.public = res.data.public;
|
||||
|
||||
@@ -203,7 +203,6 @@ export default {
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
return Promise.reject(res);
|
||||
//throw new Error(res);
|
||||
}
|
||||
if (res.data != true) {
|
||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
@@ -233,7 +232,8 @@ export default {
|
||||
`trial/seed/${vm.obj.seedLevel}/${vm.obj.timeZoneOffset}`
|
||||
);
|
||||
if (jobId.error) {
|
||||
throw new Error(jobId.error);
|
||||
//throw new Error(jobId.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
|
||||
}
|
||||
jobId = jobId.jobId; //it's in a sub key
|
||||
//indicate loading by setting on button
|
||||
@@ -260,7 +260,10 @@ export default {
|
||||
`job-operations/status/${jobId}`
|
||||
);
|
||||
if (jobStatus.error) {
|
||||
throw new Error(jobStatus.error);
|
||||
//throw new Error(jobStatus.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
||||
);
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
if (jobStatus == 4 || jobStatus == 0) {
|
||||
|
||||
@@ -1172,7 +1172,6 @@ async function fetchReportData(vm) {
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
return Promise.reject(res);
|
||||
//throw new Error(res);
|
||||
} else {
|
||||
vm.reportData = res.data;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,8 @@ export default {
|
||||
//this is to ensure that when a user is viewing the latest notifications they don't see the NEW count still in the bell icon in menu since they are viewing them live
|
||||
let status = await window.$gz.api.get("notify/new-count");
|
||||
if (status.error) {
|
||||
throw new Error(status.error);
|
||||
//throw new Error(status.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(status, vm));
|
||||
}
|
||||
window.$gz.store.commit("setNewNotificationCount", status.data);
|
||||
}
|
||||
|
||||
@@ -383,7 +383,6 @@ export default {
|
||||
//move focus to password
|
||||
document.getElementsByName("password")[0].focus();
|
||||
},
|
||||
|
||||
async login() {
|
||||
let vm = this;
|
||||
if (vm.input.username != "" && vm.input.password != "") {
|
||||
@@ -403,7 +402,8 @@ export default {
|
||||
|
||||
if (res.error) {
|
||||
//don't expect this to ever get called but just in case
|
||||
throw new Error(res.error);
|
||||
// throw new Error(res.error);
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
}
|
||||
await processLogin(res.data, loggedInWithKnownPassword);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user