mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Increase the visibility of permanent task failures in task queue
Make permanent failures always reach the log. Make `bin/worker execute` report exceptions properly.
This commit is contained in:
parent
8a6acf88e0
commit
6b86f81fe4
2 changed files with 5 additions and 7 deletions
|
@ -21,17 +21,15 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
|
|||
$ex = $task->getExecutionException();
|
||||
if ($ex) {
|
||||
if ($ex instanceof PhabricatorWorkerPermanentFailureException) {
|
||||
$this->log(
|
||||
pht(
|
||||
'Task %s failed permanently: %s',
|
||||
$id,
|
||||
$ex->getMessage()));
|
||||
throw new PhutilProxyException(
|
||||
pht('Permanent failure while executing Task ID %d.', $id),
|
||||
$ex);
|
||||
} else if ($ex instanceof PhabricatorWorkerYieldException) {
|
||||
$this->log(pht('Task %s yielded.', $id));
|
||||
} else {
|
||||
$this->log("Task {$id} failed!");
|
||||
throw new PhutilProxyException(
|
||||
"Error while executing task ID {$id} from queue.",
|
||||
pht('Error while executing Task ID %d.', $id),
|
||||
$ex);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -47,7 +47,7 @@ final class PhabricatorWorkerManagementExecuteWorkflow
|
|||
|
||||
$console->writeOut("Executing task {$id} ({$class})...");
|
||||
|
||||
$task->executeTask();
|
||||
$task = $task->executeTask();
|
||||
$ex = $task->getExecutionException();
|
||||
|
||||
if ($ex) {
|
||||
|
|
Loading…
Reference in a new issue