Only output if there's a failure
This commit is contained in:
@@ -14,6 +14,8 @@ class Mrsk::Cli::Healthcheck < Mrsk::Cli::Base
|
|||||||
raise SSHKit::Command::Failed, "#{target} failed to return 200 OK!"
|
raise SSHKit::Command::Failed, "#{target} failed to return 200 OK!"
|
||||||
end
|
end
|
||||||
rescue SSHKit::Command::Failed => e
|
rescue SSHKit::Command::Failed => e
|
||||||
|
error capture_with_info(*MRSK.healthcheck.logs)
|
||||||
|
|
||||||
if e.message =~ /curl/
|
if e.message =~ /curl/
|
||||||
# Catches 4xx, 5xx
|
# Catches 4xx, 5xx
|
||||||
raise SSHKit::Command::Failed, "#{target} failed to return 200 OK!"
|
raise SSHKit::Command::Failed, "#{target} failed to return 200 OK!"
|
||||||
@@ -21,7 +23,6 @@ class Mrsk::Cli::Healthcheck < Mrsk::Cli::Base
|
|||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
error capture_with_info(*MRSK.healthcheck.logs)
|
|
||||||
execute *MRSK.healthcheck.stop, raise_on_non_zero_exit: false
|
execute *MRSK.healthcheck.stop, raise_on_non_zero_exit: false
|
||||||
execute *MRSK.healthcheck.remove, raise_on_non_zero_exit: false
|
execute *MRSK.healthcheck.remove, raise_on_non_zero_exit: false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user