Skip to content

Commit

Permalink
Merge pull request #49 from Glavin001/master
Browse files Browse the repository at this point in the history
Add error handler for sending WebSocket message
  • Loading branch information
alallier authored Nov 1, 2016
2 parents adbcfa6 + 963464b commit 07a3978
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ module.exports = function reload (httpServer, expressApp, verboseLogging) {
},
'sendMessage': function (command) {
if (conn) {
conn.send(command)
conn.send(command, function (error) {
console.error(error)
})
} else {
if (verboseLogging) {
console.log('Cannot send "' + command + '" to client: still not connected')
Expand Down

0 comments on commit 07a3978

Please sign in to comment.