Fix ts error in portal after enabling more strict checks

This commit is contained in:
Leonid Logvinov
2018-01-10 12:39:37 +01:00
parent fa7237fde7
commit e34b0af251
12 changed files with 42 additions and 38 deletions

View File

@@ -20,7 +20,7 @@ export const docUtils = {
// TODO: Show the user an error message when the docs fail to load
const errMsg = await response.text();
utils.consoleLog(`Failed to load JSON file list: ${response.status} ${errMsg}`);
return;
throw new Error(errMsg);
}
const responseXML = await response.text();
const responseJSONString = convert.xml2json(responseXML, {
@@ -43,7 +43,7 @@ export const docUtils = {
// TODO: Show the user an error message when the docs fail to load
const errMsg = await response.text();
utils.consoleLog(`Failed to load Doc JSON: ${response.status} ${errMsg}`);
return;
throw new Error(errMsg);
}
const jsonDocObj = await response.json();
return jsonDocObj;