Feature Requests: Browse | Submit New | Admin

[#20765] add &block to run (like rake's sh) to handle errors

Date:
2008-06-21 16:47
Priority:
3
Submitted By:
Daniel Kionka (dkionka)
Assigned To:
Ryan Davis (zenspider)
Category:
vlad
State:
Open
Summary:
add &block to run (like rake's sh) to handle errors

Detailed description
I need conditional commands in my deploy script.  I run diff on my rails image to conditionally update and restart it.
It looks like the only way to get the result is to put the run in a begin/rescue.

The rake sh method has an optional block that gets |ok, res|, and you can set your results without needing a rescue
to catch the error code.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-07-31 11:39
Sender: Daniel Kionka

Sorry, it has been a year, and I no longer use Ruby, so I 
can't remember the details.

There was no good way to handle error codes.  I looked at 
rake's sh, and it handled it very well -- you can have a 
block that handles the error.  If you look at the sh 
method, it should be obvious what is missing.
Date: 2009-07-30 05:44
Sender: Ryan Davis

still no response... considering punting.
Date: 2009-03-05 17:41
Sender: Ryan Davis

run executes on each thread for each host. What should it do?

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
summaryadd &block to run (like rake's sh) to handle errors2009-07-31 11:39dkionka