aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-10 09:23:16 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-10 09:23:16 +0100
commit395f9e80ae7e5b7f5e96037daa05b48d97021210 (patch)
treeab686e278db5cdec2d9b39bcf31c2cd2fd3b713f
parent437f5bec7f20aaed5480f10c7bc2fcff57a0f934 (diff)
downloadpaludis-395f9e80ae7e5b7f5e96037daa05b48d97021210.tar.gz
paludis-395f9e80ae7e5b7f5e96037daa05b48d97021210.tar.xz
Make 'cave perform' call fail hooks
Fixes: ticket:958
-rw-r--r--src/clients/cave/cmd_perform.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 8586faa..0e16076 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -248,7 +248,22 @@ namespace
).max_exit_status())
throw ActionAbortedError("Aborted by hook");
- id->perform_action(action);
+ try
+ {
+ id->perform_action(action);
+ }
+ catch (const ActionFailedError & e)
+ {
+ if (cmdline.a_hooks.specified())
+ {
+ HookResult PALUDIS_ATTRIBUTE((unused)) dummy(env->perform_hook(Hook(action_name + "_fail")
+ ("TARGET", stringify(*id))
+ ("MESSAGE", e.message())
+ ("X_OF_Y", cmdline.a_x_of_y.argument())
+ ));
+ throw;
+ }
+ }
if (cmdline.a_hooks.specified())
if (0 != env->perform_hook(Hook(action_name + "_post")