Skip to content

Commit

Permalink
Merge pull request #78 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
prevent crash of BackendMicroservice done function
  • Loading branch information
jeanmachuca committed Jul 11, 2021
2 parents 5cdf85c + 27d7751 commit 0f46ae9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3416,12 +3416,21 @@
logger.debug("Something wrong writing the response for microservice" + e.toString());
}
},
done: function() {
done: function () {
logger.debugEnabled = true;
var microservice = this;
var stream = microservice.stream;
stream.respond(microservice.headers);
try {
stream.respond(microservice.headers);
} catch (e){
logger.debug(e.toString());
}
if (microservice.body !== null) {
microservice.finishWithBody.call(microservice, stream);
try {
microservice.finishWithBody.call(microservice, stream);
} catch (e){
logger.debug(e.toString());
}
}
}
});
Expand Down

0 comments on commit 0f46ae9

Please sign in to comment.