Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(mock-server): expose potential errors in message handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Dec 11, 2017
1 parent 99acbab commit 65dcca4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/mock/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ Server.prototype.start = function() {
self.on('message', function(message, connection) {
var request = new Request(self, connection, message);
if (self.messageHandler) {
self.messageHandler(request);
try {
self.messageHandler(request);
} catch (err) {
console.log(err.stack);
}
} else {
self.messages.push(request);
}
Expand Down

0 comments on commit 65dcca4

Please sign in to comment.