Skip to content

fix: do not parse return value of errored tasks - #692

Open
sinnercode228 wants to merge 1 commit into
taskiq-python:masterfrom
sinnercode228:fix/no-parse-warning-on-errored-result
Open

sinnercode228 wants to merge 1 commit into
taskiq-python:masterfrom
sinnercode228:fix/no-parse-warning-on-errored-result

Conversation

@sinnercode228

Copy link
Copy Markdown

When a task fails, the receiver stores a result with is_err=True and return_value=None. AsyncTaskiqTask.get_result still tried to validate that None against the task's return annotation, so every failed task with a non-optional return type logged a misleading "Cannot parse return type into ..." warning on the client side.

Skip the validation when the result is an error: there is no return value to parse, and the actual failure is already available in result.error.

Closes: #479

When a task fails, the receiver stores a result with `is_err=True` and
`return_value=None`. `AsyncTaskiqTask.get_result` still tried to validate
that `None` against the task's return annotation, so every failed task
with a non-optional return type logged a misleading
"Cannot parse return type into ..." warning on the client side.

Skip the validation when the result is an error: there is no return value
to parse, and the actual failure is already available in `result.error`.

Closes: taskiq-python#479

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Noisy "Cannot parse return type..." log warning on task error

1 participant