improve error message

This commit is contained in:
Jinesh Jain
2025-07-13 17:52:05 +05:30
parent 5fcfc677f3
commit b81168dae9

View File

@ -44,7 +44,9 @@ async def decode_uvarint_from_stream(reader: Reader) -> int:
res = 0
for shift in itertools.count(0, 7):
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)
value = byte[0]