Skip to content
Snippets Groups Projects
Commit 4ef3987f authored by Mathias Brodala's avatar Mathias Brodala Committed by Wouter Wolters
Browse files

[BUGFIX] Rethrow Extbase scheduler task exceptions

This makes sure exception details thrown in Extbase scheduler tasks
can be shown by the Scheduler.

Resolves: #49071
Releases: master, 6.2
Change-Id: Ic703568715bf92523a9cbd0dcab6c5606ea278bb
Reviewed-on: http://review.typo3.org/36985


Reviewed-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent 2f4d1314
Branches
Tags
No related merge requests found
......@@ -86,16 +86,18 @@ class Task extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
/**
* Function execute from the Scheduler
*
* @return bool TRUE on successful execution, FALSE on error
* @return bool TRUE on successful execution
* @throws \Exception If an error occurs
*/
public function execute() {
try {
$this->taskExecutor->execute($this);
return TRUE;
} catch (\Exception $e) {
$this->logException($e);
return FALSE;
// Make sure the Scheduler gets exception details
throw $e;
}
return TRUE;
}
/**
......
......@@ -36,9 +36,10 @@ class TaskTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
/**
* @test
* @expectedException Exception
* @author Alexander Schnitzler <alex.schnitzler@typovision.de>
*/
public function executeCallsLogExceptionOnCaughtException() {
public function executeCallsLogExceptionOnCaughtExceptionAndRethrowsException() {
$this->taskExecutor->expects($this->once())->method('execute')->will($this->throwException(new \Exception()));
$this->task->_set('taskExecutor', $this->taskExecutor);
$this->task->expects($this->once())->method('logException');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment