Skip to content

Commit

Permalink
behave better when service down [SCT-1075]
Browse files Browse the repository at this point in the history
  • Loading branch information
eapearson committed Jun 13, 2018
1 parent b76c7c5 commit b06ac6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"kbase-knockout-extensions-es6": "0.1.4",
"kbase-common-ts": "0.18.0",
"kbase-common-js": "2.16.1",
"kbase-common-es6": "0.5.1",
"kbase-common-es6": "0.5.2",
"kbase-sdk-clients-js": "0.5.1",
"kbase-service-clients-js": "3.3.5",
"kbase-ui-widget": "1.3.0",
Expand Down
12 changes: 10 additions & 2 deletions src/client/modules/lib/kbaseServiceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ define([
throw new Error(errorMessage);
} else {
console.error(errorMessage);
return null;
}

});
}

Expand All @@ -70,6 +70,7 @@ define([
throw new Error(errorMessage);
} else {
console.error(errorMessage);
return null;
}
});
}
Expand All @@ -89,11 +90,18 @@ define([
throw new Error(errorMessage);
} else {
console.error(errorMessage);
return null;
}
}
}).then((result) => {
let version;
if (serviceConfig.version.propertyPath) {
if (result === null) {
if (!this.throwErrors) {
return null;
} else {
throw new Error('Invalid semver check result: ' + result);
}
} else if (serviceConfig.version.propertyPath) {
version = props.getProp(result, serviceConfig.version.propertyPath);
} else {
version = result;
Expand Down

0 comments on commit b06ac6e

Please sign in to comment.