Continue the process even if posting a message to Slack is failed #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is addressing the issue #40. After merging this PR,
slacktee
continues the process even if posting a message to Slack is failed.The content of #40 is below:
Currently, slacktee exits immediately with the error code if it fails to send a message to Slack or some other errors happen (e.g. webhook URL is not configured).
However, this was not ideal behavior as a tee-like-command because it blocks piped subsequent commands.
Here is the example:
cat test.txt | slacktee -n | mail foo@bar.com
If webhook URL is not configured,
slacktee
fails immediately and following mail command cannot read the output of cat command.cat test.txt | tee inaccessible_file.txt | mail foo@bar.com
Even if tee cannot open
inaccessible_file.txt
,tee
outputs an error message to STDERR and then continues to pass the input tomail
command.In order to minimize the chance to interfere the operation of the piped subsequent commands,
slacktee
should try to follow the error handling behavior oftee
command.