File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -199,10 +199,14 @@ 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
206
status , headers , body = (
203
207
http .HTTPStatus .BAD_REQUEST ,
204
208
Headers (),
205
- f"Failed to open a WebSocket connection: { exc } .\n " .encode (),
209
+ f"Failed to open a WebSocket connection: { exc_str } .\n " .encode (),
206
210
)
207
211
else :
208
212
self .logger .error ("opening handshake failed" , exc_info = True )
Original file line number Diff line number Diff line change @@ -163,9 +163,13 @@ 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
170
return self .reject (
167
171
http .HTTPStatus .BAD_REQUEST ,
168
- f"Failed to open a WebSocket connection: { exc } .\n " ,
172
+ f"Failed to open a WebSocket connection: { exc_str } .\n " ,
169
173
)
170
174
except Exception as exc :
171
175
# Handle exceptions raised by user-provided select_subprotocol and
You can’t perform that action at this time.
0 commit comments