1
0
Fork 0
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:
epriestley 2015-03-15 13:27:05 -07:00
parent 8a6acf88e0
commit 6b86f81fe4
2 changed files with 5 additions and 7 deletions

View file

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

View file

@ -47,7 +47,7 @@ final class PhabricatorWorkerManagementExecuteWorkflow
$console->writeOut("Executing task {$id} ({$class})...");
$task->executeTask();
$task = $task->executeTask();
$ex = $task->getExecutionException();
if ($ex) {