Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion starlette/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def dispatch(self) -> None:
break
except Exception as exc:
close_code = status.WS_1011_INTERNAL_ERROR
raise exc from None
raise exc
finally:
await self.on_disconnect(websocket, close_code)

Expand Down
2 changes: 1 addition & 1 deletion starlette/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def sender(message: Message) -> None:
handler = self._lookup_exception_handler(exc)

if handler is None:
raise exc from None
raise exc

if response_started:
msg = "Caught handled exception, but response already started."
Expand Down
2 changes: 1 addition & 1 deletion starlette/middleware/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def _send(message: Message) -> None:
# We always continue to raise the exception.
# This allows servers to log the error, or allows test clients
# to optionally raise the error within the test case.
raise exc from None
raise exc

def format_line(
self, index: int, line: str, frame_lineno: int, frame_index: int
Expand Down
2 changes: 1 addition & 1 deletion starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async def send(message: Message) -> None:
loop.run_until_complete(self.app(scope, receive, send))
except BaseException as exc:
if self.raise_server_exceptions:
raise exc from None
raise exc

if self.raise_server_exceptions:
assert response_started, "TestClient did not receive any response."
Expand Down