Handle case when websocket closes with error but the error reason is nil.