diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-01-14 09:49:40 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-01-14 09:49:40 +0100 |
commit | 64c8427d813445aceb019c08a417633ace17d366 (patch) | |
tree | 06eed05ef803e7cc6f897bad8bce9a17b8a581bb | |
parent | 205fbcbfa3cf221fad23cfd3379a412aba0dd314 (diff) | |
download | nextcloud-server-64c8427d813445aceb019c08a417633ace17d366.tar.gz nextcloud-server-64c8427d813445aceb019c08a417633ace17d366.zip |
Improved error message for failing background job
-rw-r--r-- | lib/private/backgroundjob/job.php | 2 | ||||
-rw-r--r-- | tests/lib/backgroundjob/job.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/backgroundjob/job.php b/lib/private/backgroundjob/job.php index 677b37e9297..4c4da94d4fd 100644 --- a/lib/private/backgroundjob/job.php +++ b/lib/private/backgroundjob/job.php @@ -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()); } } } diff --git a/tests/lib/backgroundjob/job.php b/tests/lib/backgroundjob/job.php index 912e0e13b57..f2a5ff894fe 100644 --- a/tests/lib/backgroundjob/job.php +++ b/tests/lib/backgroundjob/job.php @@ -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); |