mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-09 22:50:54 +00:00
Merge pull request #760 from Jineshbansal/improve-error-message
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]
|
||||||
|
|||||||
1
newsfragments/760.docs.rst
Normal file
1
newsfragments/760.docs.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Improve error message under the function decode_uvarint_from_stream in libp2p/utils/varint.py file
|
||||||
Reference in New Issue
Block a user