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