Skip to content

Commit

Permalink
returned out of error throw event
Browse files Browse the repository at this point in the history
  • Loading branch information
iangeckeler committed Aug 9, 2019
1 parent 0ff9f55 commit c6578e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions __tests__/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,11 @@ describe("Server tests for health check", () => {

it("getStatus method returns the full status map if not passed params");

it("getStatus method returns null if passed params", () => {});
it("getStatus method returns null if passed wrong params", () => {});

it("getStatus method returns specific status", () => {});

it("Health check implementation handler takes in call and calls getStatus", () => {});
it("getStatus method returns specific status if one provided", () => {});

it("setStatus method alters status map", () => {});

it("Server adds health check automatically", () => {});
it("Server adds health check to statusmap automatically", () => {});
});
3 changes: 1 addition & 2 deletions lib/custom-services/healthcheck-handlers/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ module.exports = function(call) {
return call.send({ health: healthArray });
}
// loop through statusMap append the ones in the services array
// if at any point it is not possible
for (let i = 0; i < requestedServices.length; i++) {
const curStatus = this.getStatus(requestedServices[i]);
if (curStatus === null || curStatus === undefined) {
call.throw(
return call.throw(
new Error(
"Requested a health check for service not in Server statusMap."
)
Expand Down

0 comments on commit c6578e7

Please sign in to comment.