Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed task signature on error handler #615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nicklaros
Copy link

Current error handler only accept error as arguments, I propose to add failed task signature to make it more useful.
Some use case is when we need to broadcast error event about failed task to notify other system.

Comment on lines -81 to -85
if worker.errorHandler != nil {
worker.errorHandler(err)
} else {
log.WARNING.Printf("Broker failed with error: %s", err)
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation about Error Handling (https://github.com/RichardKnop/machinery#error-handling) suggest that it is used for handling task related error, so I think for broker.StartConsuming error, better not use the same error handler, so here I just log it instead.

@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #615 into master will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #615      +/-   ##
==========================================
+ Coverage   37.24%   37.27%   +0.03%     
==========================================
  Files          36       36              
  Lines        3112     3109       -3     
==========================================
  Hits         1159     1159              
+ Misses       1805     1802       -3     
  Partials      148      148              
Impacted Files Coverage Δ
v2/worker.go 2.25% <0.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 260989d...108d841. Read the comment docs.

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.

None yet

1 participant