[BUGFIX] Scheduler now throws OutOfBoundsException on SQL query error 56/40256/2
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Mon, 15 Jun 2015 15:59:48 +0000 (17:59 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 15 Jun 2015 17:21:37 +0000 (19:21 +0200)
If the query for fetchTask fails for whatever reason, scheduler will
now gracefully throw an exception instead of assuming it had gotten
a valid resource pointer

Resolves: #67463
Related: #39085
Releases: master, 6.2
Change-Id: I26819df3fd173b36de6121100a6398ed4b701319
Reviewed-on: http://review.typo3.org/40256
Reviewed-by: Lienhart Woitok <lienhart.woitok@netlogix.de>
Tested-by: Lienhart Woitok <lienhart.woitok@netlogix.de>
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/scheduler/Classes/Scheduler.php

index 34b8b42..dcec923 100644 (file)
@@ -279,7 +279,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                $db = $this->getDatabaseConnection();
                $res = $db->exec_SELECT_queryArray($queryArray);
                if ($res === FALSE) {
-                       throw new \UnexpectedValueException('Query could not be executed. Possible defect in tables tx_scheduler_task or tx_scheduler_task_group', 1422044826);
+                       throw new \OutOfBoundsException('Query could not be executed. Possible defect in tables tx_scheduler_task or tx_scheduler_task_group or DB server problems', 1422044826);
                }
                // If there are no available tasks, thrown an exception
                if ($db->sql_num_rows($res) == 0) {