begin
run "something"
rescue Exception => error
puts "something broke: #{error}"
endIf you want to be more specific, all errors that capistrano explicitly raises will be subclasses of Capistrano::Error. And any errors that cap explicitly raises that are due to an error associated with a remote server will be subclasses of Capistrano::RemoteError. And any errors that cap raises due to executing a command will be Capistrano::CommandError.
- Jamis On Jan 7, 2008, at 11:28 AM, Andy Koch wrote:
Thanks Jamis, follow-up question - is it possible to detect the failure? Obviously, if a run "something" fails it may be desirable to have some fail-safe code run. Like an exception block... Regards, Andy Jamis Buck wrote:It is a per-task setting: task :foo, :on_error => :continue do # ... end With :on_error set to :continue, when a run command fails the process will not abort--the next task in the chain will be invoked. - Jamis On Jan 4, 2008, at 5:16 PM, Andy Koch wrote:Hi,I thought I once saw it listed that one could continue if a run commandreturns an error code. Is there some option that can be passed to run for this behavior? Let me rephrase that...if "run 'do something'" fails, then the whole deploy process quits, I'dlike it to continue in some cases - rather than have to start over. Thanks--~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
