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