diff --git a/index.js b/index.js index b613609..7a2b74d 100644 --- a/index.js +++ b/index.js @@ -179,7 +179,7 @@ module.exports.create = function (opts) { machine.emit('tunnelError', msg); } else { - (machine.onerror||machine.onError)(msg); + (machine.onerror||machine.onmessage)(msg); } } else {