mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Provide a hook for aborted workflow
Summary: We start Sandcastle push when `arc diff` starts. If `arc diff` throws then HHVM waits for finishing the futures. We need to kill them sooner. Test Plan: Will implement the hook. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3713
This commit is contained in:
parent
47a036a535
commit
1b51b74135
2 changed files with 24 additions and 14 deletions
|
@ -319,26 +319,28 @@ try {
|
||||||
$config->didRunWorkflow($command, $workflow, $err);
|
$config->didRunWorkflow($command, $workflow, $err);
|
||||||
exit((int)$err);
|
exit((int)$err);
|
||||||
|
|
||||||
} catch (ArcanistUsageException $ex) {
|
} catch (Exception $ex) {
|
||||||
echo phutil_console_format(
|
$is_usage = ($ex instanceof ArcanistUsageException);
|
||||||
"**Usage Exception:** %s\n",
|
if ($is_usage) {
|
||||||
$ex->getMessage());
|
echo phutil_console_format(
|
||||||
|
"**Usage Exception:** %s\n",
|
||||||
|
$ex->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$config->didAbortWorkflow($command, $workflow, $ex);
|
||||||
|
|
||||||
if ($config_trace_mode) {
|
if ($config_trace_mode) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
throw $ex;
|
throw $ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(1);
|
if (!$is_usage) {
|
||||||
} catch (Exception $ex) {
|
echo phutil_console_format(
|
||||||
if ($config_trace_mode) {
|
"**Exception**\n%s\n%s\n",
|
||||||
throw $ex;
|
$ex->getMessage(),
|
||||||
|
"(Run with --trace for a full exception trace.)");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo phutil_console_format(
|
|
||||||
"**Exception**\n%s\n%s\n",
|
|
||||||
$ex->getMessage(),
|
|
||||||
"(Run with --trace for a full exception trace.)");
|
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
* - create, replace, or disable workflows by overriding buildWorkflow()
|
* - create, replace, or disable workflows by overriding buildWorkflow()
|
||||||
* and buildAllWorkflows();
|
* and buildAllWorkflows();
|
||||||
* - add additional steps before or after workflows run by overriding
|
* - 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
|
* - add new flags to existing workflows by overriding
|
||||||
* getCustomArgumentsForCommand().
|
* getCustomArgumentsForCommand().
|
||||||
*
|
*
|
||||||
|
@ -93,6 +93,14 @@ class ArcanistConfiguration {
|
||||||
// This is a hook.
|
// This is a hook.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function didAbortWorkflow(
|
||||||
|
$command,
|
||||||
|
ArcanistBaseWorkflow $workflow,
|
||||||
|
Exception $ex) {
|
||||||
|
|
||||||
|
// This is a hook.
|
||||||
|
}
|
||||||
|
|
||||||
public function getCustomArgumentsForCommand($command) {
|
public function getCustomArgumentsForCommand($command) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue