Try using `robot.emit 'err', err, msg` instead. This would use the [error handling API](https://github.com/github/hubot/blob/master/docs/scripting.md#error-handling)