Improved error message for failing background job

This commit is contained in:
Morris Jobke 2016-01-14 09:49:40 +01:00
parent 205fbcbfa3
commit 64c8427d81
2 changed files with 2 additions and 2 deletions

View file

@ -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());
}
}
}

View file

@ -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);