$config->didRunWorkflow($command, $workflow, $err);
exit((int)$err);
-} catch (ArcanistUsageException $ex) {
- echo phutil_console_format(
- "**Usage Exception:** %s\n",
- $ex->getMessage());
- if ($config_trace_mode) {
- echo "\n";
- throw $ex;
+} catch (Exception $ex) {
+ $is_usage = ($ex instanceof ArcanistUsageException);
+ if ($is_usage) {
+ echo phutil_console_format(
+ "**Usage Exception:** %s\n",
+ $ex->getMessage());
}
- exit(1);
-} catch (Exception $ex) {
+ $config->didAbortWorkflow($command, $workflow, $ex);
+
if ($config_trace_mode) {
+ echo "\n";
throw $ex;
}
- echo phutil_console_format(
- "**Exception**\n%s\n%s\n",
- $ex->getMessage(),
- "(Run with --trace for a full exception trace.)");
+ if (!$is_usage) {
+ echo phutil_console_format(
+ "**Exception**\n%s\n%s\n",
+ $ex->getMessage(),
+ "(Run with --trace for a full exception trace.)");
+ }
exit(1);
}
* - create, replace, or disable workflows by overriding buildWorkflow()
* and buildAllWorkflows();
* - add additional steps before or after workflows run by overriding
- * willRunWorkflow() or didRunWorkflow(); and
+ * willRunWorkflow() or didRunWorkflow() or didAbortWorkflow(); and
* - add new flags to existing workflows by overriding
* getCustomArgumentsForCommand().
*
// This is a hook.
}
+ public function didAbortWorkflow(
+ $command,
+ ArcanistBaseWorkflow $workflow,
+ Exception $ex) {
+
+ // This is a hook.
+ }
+
public function getCustomArgumentsForCommand($command) {
return array();
}