Include error message on failure

This commit is contained in:
Donal McBreen
2024-04-03 10:36:32 +01:00
parent 5e492ecc4d
commit 67a2d5e7ca
2 changed files with 4 additions and 3 deletions

View File

@@ -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