add error handling
This commit is contained in:
parent
b2680b13a5
commit
e926a41a14
|
@ -30,6 +30,9 @@ class DockerManager::Upgrader
|
||||||
else
|
else
|
||||||
log("Did not find unicorn launcher")
|
log("Did not find unicorn launcher")
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
STDERR.puts("Docker Manager: FAILED TO UPGRADE")
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
|
|
||||||
def run(cmd)
|
def run(cmd)
|
||||||
|
@ -37,6 +40,11 @@ class DockerManager::Upgrader
|
||||||
IO.popen("cd #{Rails.root} && #{cmd} 2>&1") do |line|
|
IO.popen("cd #{Rails.root} && #{cmd} 2>&1") do |line|
|
||||||
log(line.read)
|
log(line.read)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless $?.success?
|
||||||
|
STDERR.puts("FAILED: #{cmd}")
|
||||||
|
raise RuntimeError
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def log(message)
|
def log(message)
|
||||||
|
|
Loading…
Reference in New Issue