File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33set -eo pipefail
44
55# lint
6- poetry run black --check .
6+ poetry run black --check --diff .
77poetry run isort --check-only .
88poetry run flake8 .
99poetry run mypy .
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def _prettify_validation_error(exc: ValidationError) -> str:
6969 err_type = err ["type" ]
7070 msg = err ["msg" ]
7171 loc = "." .join (str (x ) for x in err ["loc" ])
72- lines .append (f"\t \t [{ err_type } ] { msg } : { loc } " )
72+ lines .append (f"\t \t [{ err_type } ] { msg } : { loc } ; input: { err [ 'input' ] } ) " )
7373 return "\n " .join (lines )
7474
7575
@@ -87,9 +87,7 @@ def _create_smp_validation_exception(
8787 details += f"Frame:\n { _hexdump_ascii (frame )} \n "
8888 details += "Errors:\n "
8989 for cls , exc in errs .items ():
90- details += (
91- f"\t Could not be parsed as { cls .__name__ } because:\n { _prettify_validation_error (exc )} \n "
92- )
90+ details += f"\t Could not be parsed as { cls .__name__ } because { len (exc .errors ())} errors:\n { _prettify_validation_error (exc )} \n "
9391
9492 return SMPValidationException (msg = msg , details = details )
9593
@@ -233,7 +231,7 @@ async def request(
233231 except ValidationError as e :
234232 errs [request ._ErrorV2 ] = e
235233 exc = _create_smp_validation_exception (header , frame , errs )
236- logger .error (exc .details )
234+ logger .error (exc .msg + exc . details )
237235 raise exc from None
238236
239237 async def upload (
You can’t perform that action at this time.
0 commit comments