Show frames when decode is handed bad input

py313_support
Tyler Goodlet 2025-03-04 13:54:46 -05:00
parent b93e0cb846
commit b45874a216
1 changed files with 13 additions and 0 deletions

View File

@ -258,6 +258,9 @@ class PldRx(Struct):
f'|_pld={pld!r}\n' f'|_pld={pld!r}\n'
) )
return pld return pld
except TypeError as typerr:
__tracebackhide__: bool = False
raise typerr
# XXX pld-value type failure # XXX pld-value type failure
except ValidationError as valerr: except ValidationError as valerr:
@ -799,6 +802,11 @@ def validate_payload_msg(
roundtripped: Started|None = None roundtripped: Started|None = None
try: try:
roundtripped: Started = codec.decode(msg_bytes) roundtripped: Started = codec.decode(msg_bytes)
except TypeError as typerr:
__tracebackhide__: bool = False
raise typerr
try:
ctx: Context = getattr(ipc, 'ctx', ipc) ctx: Context = getattr(ipc, 'ctx', ipc)
pld: PayloadT = ctx.pld_rx.decode_pld( pld: PayloadT = ctx.pld_rx.decode_pld(
msg=roundtripped, msg=roundtripped,
@ -823,6 +831,11 @@ def validate_payload_msg(
) )
raise ValidationError(complaint) raise ValidationError(complaint)
# usually due to `.decode()` input type
except TypeError as typerr:
__tracebackhide__: bool = False
raise typerr
# raise any msg type error NO MATTER WHAT! # raise any msg type error NO MATTER WHAT!
except ValidationError as verr: except ValidationError as verr:
try: try: