Skip to content

Commit

Permalink
Output verbose exception msg on seperate line
Browse files Browse the repository at this point in the history
This change outputs the exception message on a worker in verbose mode on a seperate line. This allows parsing json data on console output.
  • Loading branch information
johannessteu authored Mar 5, 2020
1 parent c6efb27 commit 67343bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Command/JobCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public function workCommand($queue, $exitAfter = null, $limit = null, $verbose =
$numberOfJobExecutions ++;
$this->outputLine('<error>%s</error>', [$exception->getMessage()]);
if ($verbose && $exception->getPrevious() instanceof \Exception) {
$this->outputLine(' Reason: %s', [$exception->getPrevious()->getMessage()]);
$this->outputLine('Reason:');
$this->outputLine($exception->getPrevious()->getMessage());
}
} catch (\Exception $exception) {
$this->outputLine('<error>Unexpected exception during job execution: %s, aborting...</error>', [$exception->getMessage()]);
Expand Down

0 comments on commit 67343bd

Please sign in to comment.