Improved error message for failing background job
This commit is contained in:
parent
205fbcbfa3
commit
64c8427d81
|
@ -52,7 +52,7 @@ abstract class Job implements IJob {
|
|||
$this->run($this->argument);
|
||||
} catch (\Exception $e) {
|
||||
if ($logger) {
|
||||
$logger->error('Error while running background job: ' . $e->getMessage());
|
||||
$logger->error('Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . '): ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Job extends \Test\TestCase {
|
|||
->getMock();
|
||||
$logger->expects($this->once())
|
||||
->method('error')
|
||||
->with('Error while running background job: ');
|
||||
->with('Error while running background job (class: Test\BackgroundJob\TestJob, arguments: ): ');
|
||||
|
||||
$this->assertCount(1, $jobList->getAll());
|
||||
$job->execute($jobList, $logger);
|
||||
|
|
Loading…
Reference in New Issue