Skip to content

Commit

Permalink
Added warnings on parsing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Feb 24, 2025
1 parent 8e14595 commit 6ac884d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions taskiq/receiver/params_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ def parse_params(
# trying to parse found value as in type annotation.
message.args[argnum] = parse_obj_as(annot, value)
except (ValueError, RuntimeError) as exc:
logger.debug(exc, exc_info=True)
logger.warning(
"Can't parse argument %d for task %s. Reason: %s",
argnum,
message.task_name,
exc,
exc_info=True,
)
else:
# We try to get this parameter from kwargs.
value = message.kwargs.get(param_name)
Expand All @@ -86,4 +92,10 @@ def parse_params(
# trying to parse found value as in type annotation.
message.kwargs[param_name] = parse_obj_as(annot, value)
except (ValueError, RuntimeError) as exc:
logger.debug(exc, exc_info=True)
logger.warning(
"Can't parse argument %s for task %s. Reason: %s",
param_name,
message.task_name,
exc,
exc_info=True,
)

0 comments on commit 6ac884d

Please sign in to comment.