feat: add failOnError option to abort pipeline on notification failures - #54
feat: add failOnError option to abort pipeline on notification failures#54adamrtalbot wants to merge 2 commits into
Conversation
Add a `failOnError` configuration option (default: false) that causes
the pipeline to fail when Slack notifications cannot be delivered.
When `failOnError = true`, any notification failure (sending messages,
uploading files, adding reactions, or progress updates) will throw a
RuntimeException, aborting the pipeline. When false (default), errors
are logged as warnings and the pipeline continues.
Senders (WebhookSlackSender, BotSlackSender) now throw exceptions on
failure instead of silently swallowing errors. SlackObserver wraps all
notification calls and delegates error handling to the new
`handleNotificationError` helper based on the failOnError config.
Usage:
```nextflow
slack {
failOnError = true // default: false
}
```
Closes #45
Co-authored-by: Adam Talbot <adamrtalbot@users.noreply.github.com>
Review: feat: add failOnError optionThe implementation is clean — the IssuesDocumentation missing No example config Missing tests in Silent behavior change at default settings |
Document failOnError, add extension tests, preserve DEBUG logging for reaction failures when disabled, and align sender tests with throw behavior. Generated by Codex Co-authored-by: Cursor <cursoragent@cursor.com>
Code ReviewThis PR adds a Findings (most severe first)
void uploadFile(Path filePath, Map options) {
log.warn "Slack plugin: File upload is not supported with webhooks..."
}Because it never throws,
All three extension catch blocks unconditionally log at } catch (Exception e) {
def msg = "Slack plugin: Error sending message: ${e.message}"
log.error msg, e // always ERROR, even when failOnError=false
if (observer.config?.failOnError) {
throw new RuntimeException(msg, e)
}
}
def uploadInfo = getUploadUrl(filename, fileSize)
if (!uploadInfo) { // dead: getUploadUrl never returns null
throw new RuntimeException(...)
}
...
if (!uploadFileContent(uploadUrl, filePath)) { // dead: always returns true or throws
throw new RuntimeException(...)
}Remove both dead branches.
The class doc still reads: but |
|
Addressed Claude review in ac9a548:
|
Implements the
failOnErrorconfiguration option requested in #45.When
failOnError = true, any Slack notification failure will throw a RuntimeException and abort the pipeline. When false (default), errors are logged as warnings and the pipeline continues.Closes #45
Generated with Claude Code