throw "string" -> throw new Error("string"
This commit is contained in:
@@ -5,9 +5,9 @@ export default {
|
||||
enumKey = enumKey.toLowerCase();
|
||||
if (enumKey != "authorizationroles") {
|
||||
if (window.$gz.store.state.enums[enumKey] == undefined) {
|
||||
throw "ERROR enums::get -> enumKey " +
|
||||
enumKey +
|
||||
" is missing from store";
|
||||
throw new Error(
|
||||
"ERROR enums::get -> enumKey " + enumKey + " is missing from store"
|
||||
);
|
||||
}
|
||||
return window.$gz.store.state.enums[enumKey][enumValue];
|
||||
} else {
|
||||
@@ -34,9 +34,11 @@ export default {
|
||||
enumKey = enumKey.toLowerCase();
|
||||
let e = window.$gz.store.state.enums[enumKey];
|
||||
if (!e) {
|
||||
throw "ERROR enums::getSelectionList -> enumKey " +
|
||||
enumKey +
|
||||
" is missing from store";
|
||||
throw new Error(
|
||||
"ERROR enums::getSelectionList -> enumKey " +
|
||||
enumKey +
|
||||
" is missing from store"
|
||||
);
|
||||
}
|
||||
let ret = [];
|
||||
//turn it into an array suitable for selection lists
|
||||
@@ -85,7 +87,7 @@ export default {
|
||||
let res = await window.$gz.api.get("enum-list/list/" + enumKey);
|
||||
//We never expect there to be no data here
|
||||
if (!res.hasOwnProperty("data")) {
|
||||
throw res;
|
||||
throw new Error(res);
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user