capistrano/capistrano — pull request #756 by seenmyfate (2013-11-01 12:27:09+00:00)
Title: Add hook for deploy failure

If an error is raised during a deploy, the task `deploy:failed` will be
triggered. Custom tasks can hook into this using `after`:

after 'deploy:failed', :send_for_help do
#
end

I've also taken the opportunity to provide a marginally more useful
error message before triggering the task.

By default, this 'deploy:failed' will only be triggered when running
`cap
deploy` - to trigger after individual tasks use `set
:deploying, true`

This closes #708 and replaces
https://github.com/capistrano/capistrano/pull/720