mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 08:00:54 +00:00
improve error message
This commit is contained in:
@ -44,7 +44,9 @@ async def decode_uvarint_from_stream(reader: Reader) -> int:
|
|||||||
res = 0
|
res = 0
|
||||||
for shift in itertools.count(0, 7):
|
for shift in itertools.count(0, 7):
|
||||||
if shift > SHIFT_64_BIT_MAX:
|
if shift > SHIFT_64_BIT_MAX:
|
||||||
raise ParseError("TODO: better exception msg: Integer is too large...")
|
raise ParseError(
|
||||||
|
"Varint decoding error: integer exceeds maximum size of 64 bits."
|
||||||
|
)
|
||||||
|
|
||||||
byte = await read_exactly(reader, 1)
|
byte = await read_exactly(reader, 1)
|
||||||
value = byte[0]
|
value = byte[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user