Fixed incorrect handling of the code smell for the reject API call

This commit is contained in:
Akshay Joshi
2024-06-17 18:22:38 +05:30
parent 3706c3126a
commit 2b04f3ca1d
26 changed files with 44 additions and 42 deletions

View File

@@ -124,7 +124,7 @@ export function getNodeAjaxOptions(url, nodeObj, treeNodeInfo, itemNodeData, par
otherParams.useCache && cacheNode.cache(nodeObj.type + '#' + url, treeNodeInfo, cacheLevel, data);
resolve(transform(data));
}).catch((err)=>{
reject(new Error(err));
reject(err instanceof Error ? err : Error('Something went wrong'));
});
} else {
// To fetch only options from cache, we do not need time from 'at'