Include error message on failure
This commit is contained in:
@@ -158,8 +158,8 @@ module Kamal::Cli
|
||||
say "Running the #{hook} hook...", :magenta
|
||||
run_locally do
|
||||
execute *KAMAL.hook.run(hook, **details, **extra_details)
|
||||
rescue SSHKit::Command::Failed
|
||||
raise HookError.new("Hook `#{hook}` failed")
|
||||
rescue SSHKit::Command::Failed => e
|
||||
raise HookError.new("Hook `#{hook}` failed:\n#{e.message}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,7 +51,8 @@ class CliBuildTest < CliTestCase
|
||||
test "push pre-build hook failure" do
|
||||
fail_hook("pre-build")
|
||||
|
||||
assert_raises(Kamal::Cli::HookError) { run_command("push") }
|
||||
error = assert_raises(Kamal::Cli::HookError) { run_command("push") }
|
||||
assert_equal "Hook `pre-build` failed:\nfailed", error.message
|
||||
|
||||
assert @executions.none? { |args| args[0..2] == [ :docker, :buildx, :build ] }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user