{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/100","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/100/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/100/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/100","id":60711434,"number":100,"title":"Get websocket data in exception handler","user":{"login":"Romainpaulus","id":2269709,"avatar_url":"https://avatars.githubusercontent.com/u/2269709?v=3","gravatar_id":"","url":"https://api.github.com/users/Romainpaulus","html_url":"https://github.com/Romainpaulus","followers_url":"https://api.github.com/users/Romainpaulus/followers","following_url":"https://api.github.com/users/Romainpaulus/following{/other_user}","gists_url":"https://api.github.com/users/Romainpaulus/gists{/gist_id}","starred_url":"https://api.github.com/users/Romainpaulus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Romainpaulus/subscriptions","organizations_url":"https://api.github.com/users/Romainpaulus/orgs","repos_url":"https://api.github.com/users/Romainpaulus/repos","events_url":"https://api.github.com/users/Romainpaulus/events{/privacy}","received_events_url":"https://api.github.com/users/Romainpaulus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-11T18:59:09Z","updated_at":"2015-03-13T05:25:45Z","closed_at":null,"body":"I want to access the websocket data for exception logging, similarly to this example:\r\n```\r\nsocketio = SocketIO()\r\n\r\n@socketio.on_error_default\r\ndef error_handler(e):\r\n    # Log the exception with event data\r\n    pass\r\n\r\n@socketio.on('my event')\r\ndef message_hander(data):\r\n    raise RuntimeError()\r\n```\r\n\r\nFrom what I have seen so far, there is no simple way to get the `data` that was passed to the `message_handler` function inside the `error_handler`, unless overriding the `socketio.on` decorator. I want to submit a pull request that will achieve this, but I want to know first if there is a way to do this without changing the `socketio.on` method. Is there, for instance, a `request` attribute that contains the current websocket message and data?"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/78810433","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/100#issuecomment-78810433","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/100","id":78810433,"user":{"login":"Romainpaulus","id":2269709,"avatar_url":"https://avatars.githubusercontent.com/u/2269709?v=3","gravatar_id":"","url":"https://api.github.com/users/Romainpaulus","html_url":"https://github.com/Romainpaulus","followers_url":"https://api.github.com/users/Romainpaulus/followers","following_url":"https://api.github.com/users/Romainpaulus/following{/other_user}","gists_url":"https://api.github.com/users/Romainpaulus/gists{/gist_id}","starred_url":"https://api.github.com/users/Romainpaulus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Romainpaulus/subscriptions","organizations_url":"https://api.github.com/users/Romainpaulus/orgs","repos_url":"https://api.github.com/users/Romainpaulus/repos","events_url":"https://api.github.com/users/Romainpaulus/events{/privacy}","received_events_url":"https://api.github.com/users/Romainpaulus/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T05:25:45Z","updated_at":"2015-03-13T05:25:45Z","body":"Sounds good, I'm going to work on this."}}