better error reporting on websocket close