File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -199,10 +199,11 @@ async def handler(self) -> None:
199
199
elif isinstance (exc , InvalidHandshake ):
200
200
if self .debug :
201
201
self .logger .debug ("! invalid handshake" , exc_info = True )
202
- exc_str = f"{ exc } "
203
- while exc .__cause__ is not None :
204
- exc = exc .__cause__
205
- exc_str += f"; { exc } "
202
+ exc_chain = cast (BaseException , exc )
203
+ exc_str = f"{ exc_chain } "
204
+ while exc_chain .__cause__ is not None :
205
+ exc_chain = exc_chain .__cause__
206
+ exc_str += f"; { exc_chain } "
206
207
status , headers , body = (
207
208
http .HTTPStatus .BAD_REQUEST ,
208
209
Headers (),
Original file line number Diff line number Diff line change @@ -163,10 +163,11 @@ def accept(self, request: Request) -> Response:
163
163
self .handshake_exc = exc
164
164
if self .debug :
165
165
self .logger .debug ("! invalid handshake" , exc_info = True )
166
- exc_str = f"{ exc } "
167
- while exc .__cause__ is not None :
168
- exc = exc .__cause__
169
- exc_str += f"; { exc } "
166
+ exc_chain = cast (BaseException , exc )
167
+ exc_str = f"{ exc_chain } "
168
+ while exc_chain .__cause__ is not None :
169
+ exc_chain = exc_chain .__cause__
170
+ exc_str += f"; { exc_chain } "
170
171
return self .reject (
171
172
http .HTTPStatus .BAD_REQUEST ,
172
173
f"Failed to open a WebSocket connection: { exc_str } .\n " ,
You can’t perform that action at this time.
0 commit comments