Use raise from
to reserve stacktrace
This commit is contained in:
parent
b85bab1a09
commit
ddfbf9ffc8
|
@ -18,7 +18,7 @@ class RawConnection(IRawConnection):
|
|||
try:
|
||||
await self.stream.write(data)
|
||||
except IOException as error:
|
||||
raise RawConnError(error)
|
||||
raise RawConnError from error
|
||||
|
||||
async def read(self, n: int = None) -> bytes:
|
||||
"""
|
||||
|
@ -30,7 +30,7 @@ class RawConnection(IRawConnection):
|
|||
try:
|
||||
return await self.stream.read(n)
|
||||
except IOException as error:
|
||||
raise RawConnError(error)
|
||||
raise RawConnError from error
|
||||
|
||||
async def close(self) -> None:
|
||||
await self.stream.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user