Skip to content

Failed task signature on error handler#615

Open
nicklaros wants to merge 1 commit intoRichardKnop:masterfrom
nicklaros:error-handler
Open

Failed task signature on error handler#615
nicklaros wants to merge 1 commit intoRichardKnop:masterfrom
nicklaros:error-handler

Conversation

@nicklaros
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

codecov bot commented Oct 28, 2020

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.27%. Comparing base (260989d) to head (108d841).
⚠️ Report is 62 commits behind head on master.

Files with missing lines Patch % Lines
v2/worker.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant