Better error handling in CorpusAnalysisApp

This commit is contained in:
Patrick Jentsch committed 2023-07-18 17:18:04 +02:00
1 parent e4f435c5ee
commit 7a925b6a19
3 files changed
+25 -17

No files matched your search

+5 -1
View File
@@ -30,7 +30,11 @@ cqi.api.APIClient = class APIClient {
} else if (response.code === 500) {
throw new Error(`[${response.code}] ${response.msg}`);
} else if (response.code === 502) {
throw new cqi.errors.lookup[response.payload.code]();
if (response.payload.code in cqi.errors.lookup) {
throw new cqi.errors.lookup[response.payload.code]();
} else {
throw new cqi.errors.CQiError();
}
}
}