miguelgrinberg / flask-sock

Modern WebSocket support for Flask.
MIT License
274 stars 24 forks source link

hack for issue #25 #26

Closed meinradr closed 2 years ago

meinradr commented 2 years ago

werkzeug debug mode: less verbose when socket closed

This is a hack to reduce the Exception message to a bare minimum when a socket is closed in werkzeug debug mode. This is done by temporarily setting sys.tracebacklimit to 0. The message is now only 2 lines instead of 8. This is a hack for issue #25

miguelgrinberg commented 2 years ago

I don't believe the fix for this issue belongs here, even more so when it is so hacky/obscure. This issue should be fixed in Werkzeug. The stack trace is a small annoyance in my opinion, so I prefer to live with it until someone (maybe myself if/when I find some time) addresses the problem on the Werkzeug side.