This commit is contained in:
@@ -42,8 +42,8 @@ export default {
|
||||
|
||||
if (!window.$gz._.has(window.$gz.store.state.enums, k)) {
|
||||
let that = this;
|
||||
|
||||
await that.fetchEnumKey(k).then(dat => {
|
||||
// eslint-disable-next-line
|
||||
await that.fetchEnumKey(k).then((dat) => {
|
||||
//massage the data as necessary
|
||||
let e = { enumKey: k, items: {} };
|
||||
for (let i = 0; i < dat.length; i++) {
|
||||
@@ -57,9 +57,11 @@ export default {
|
||||
}
|
||||
},
|
||||
fetchEnumKey(enumKey) {
|
||||
return window.$gz.api.get("enum-list/list/" + enumKey).then(res => {
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
// eslint-disable-next-line
|
||||
return window.$gz.api.get("enum-list/list/" + enumKey).then((res) => {
|
||||
//We never expect there to be no data here
|
||||
if (!res.data) {
|
||||
throw res;
|
||||
}
|
||||
return res.data;
|
||||
});
|
||||
|
||||
@@ -130,6 +130,15 @@ export default {
|
||||
msg += "\n";
|
||||
}
|
||||
dealWithError(msg, vm);
|
||||
} else if (err instanceof Response) {
|
||||
let msg =
|
||||
"http error: " +
|
||||
err.statusText +
|
||||
" - " +
|
||||
err.status +
|
||||
" Url: " +
|
||||
err.url;
|
||||
dealWithError(msg, vm);
|
||||
} else {
|
||||
//last resort
|
||||
let msg = JSON.stringify(err);
|
||||
|
||||
Reference in New Issue
Block a user