Flask-SocketIO icon indicating copy to clipboard operation
Flask-SocketIO copied to clipboard

How to create error handler in Class based Namespace

Open codyleyhan opened this issue 5 years ago • 3 comments

Hello, I am trying to use a class based namespace and would like to have my error handler in that class, I have a function named on_error(self, e) as well as trying on_error_default(self, e) but neither seem to work, is there any way to have the error handler in the class?

codyleyhan avatar Nov 13 '18 04:11 codyleyhan

Errors are not dispatched to class based namespaces at this time. You can workaround this limitation by creating an error handler that invokes the on_error() method in your namespace.

It's a good feature, though.

miguelgrinberg avatar Nov 13 '18 23:11 miguelgrinberg

@codyleyhan @miguelgrinberg any updates on this issue since https://github.com/miguelgrinberg/Flask-SocketIO/pull/834 was closed last summer? I'm attempting to implement error handling in the on_connect of a custom namespace and think I'm running into this issue.

joshbriegal avatar Mar 31 '20 12:03 joshbriegal

@joshbriegal no updates. The PR was incomplete and the author did not respond to my feedback.

miguelgrinberg avatar Mar 31 '20 14:03 miguelgrinberg