]> source.dussan.org Git - nextcloud-server.git/commitdiff
Improved error message for failing background job
authorMorris Jobke <hey@morrisjobke.de>
Thu, 14 Jan 2016 08:49:40 +0000 (09:49 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 14 Jan 2016 08:49:40 +0000 (09:49 +0100)
lib/private/backgroundjob/job.php
tests/lib/backgroundjob/job.php

index 677b37e9297b66db2244f60b52913d09b9dab6fd..4c4da94d4fdde465322b6ec2ce9ffb51d7ccef53 100644 (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());
                        }
                }
        }
index 912e0e13b57b6a0719d21cae36312ca70c4b52b9..f2a5ff894fe92e8f7e95f755827f822f9312dc2e 100644 (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);