Breaking: #110637 - Scheduler repository throws InvalidTaskException
See forge#110637
Description
The
Scheduler and
Scheduler methods now throw
\TYPO3\ when a Scheduler
task cannot be deserialized or is otherwise invalid. Previously, the global
\Unexpected was thrown.
Impact
Code that catches
\Unexpected when retrieving invalid
Scheduler tasks will no longer catch the exception.
Affected installations
Installations are affected when custom extension code directly uses
Scheduler and handles invalid tasks by catching
\Unexpected.
Migration
Catch
Invalid instead of
\Unexpected.
Before:
try {
$task = $schedulerTaskRepository->findByUid($taskUid);
} catch (\UnexpectedValueException) {
// Handle the invalid task.
}
After:
use TYPO3\CMS\Scheduler\Exception\InvalidTaskException;
try {
$task = $schedulerTaskRepository->findByUid($taskUid);
} catch (InvalidTaskException) {
// Handle the invalid task.
}
Apply the same change when calling
find.