{"action":"opened","issue":{"url":"https://api.github.com/repos/socketio/socket.io/issues/2285","labels_url":"https://api.github.com/repos/socketio/socket.io/issues/2285/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io/issues/2285/comments","events_url":"https://api.github.com/repos/socketio/socket.io/issues/2285/events","html_url":"https://github.com/socketio/socket.io/issues/2285","id":113085311,"number":2285,"title":"Calling socket.emit('error') on server always throws error","user":{"login":"nick-allen","id":2085843,"avatar_url":"https://avatars.githubusercontent.com/u/2085843?v=3","gravatar_id":"","url":"https://api.github.com/users/nick-allen","html_url":"https://github.com/nick-allen","followers_url":"https://api.github.com/users/nick-allen/followers","following_url":"https://api.github.com/users/nick-allen/following{/other_user}","gists_url":"https://api.github.com/users/nick-allen/gists{/gist_id}","starred_url":"https://api.github.com/users/nick-allen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nick-allen/subscriptions","organizations_url":"https://api.github.com/users/nick-allen/orgs","repos_url":"https://api.github.com/users/nick-allen/repos","events_url":"https://api.github.com/users/nick-allen/events{/privacy}","received_events_url":"https://api.github.com/users/nick-allen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-23T19:31:51Z","updated_at":"2015-10-23T19:31:51Z","closed_at":null,"body":"From the server, attempting to call `socket.emit(\"error\", payload);` always throws an error. This occurs whether the connect client socket has an handler for the 'error' event or not.\r\n\r\n```\r\n> io = require('socket.io').listen(3000)\r\n### Connect a client ###\r\n> socket = io.sockets.sockets[0]\r\nSocket {\r\n...\r\n}\r\n> socket.emit(\"error\", \"Message\");\r\nError: Uncaught, unspecified \"error\" event. (Message)\r\n    at Socket.emit (events.js:144:17)\r\n    at Socket.emit (<PATH>/socket.io/lib/socket.js:129:10)\r\n    at repl:1:3\r\n    at REPLServer.defaultEval (repl.js:164:27)\r\n    at bound (domain.js:250:14)\r\n    at REPLServer.runBound [as eval] (domain.js:263:12)\r\n    at REPLServer.<anonymous> (repl.js:393:12)\r\n    at emitOne (events.js:82:20)\r\n    at REPLServer.emit (events.js:169:7)\r\n    at REPLServer.Interface._onLine (readline.js:210:10)\r\n```"}}