Breaking: #110999 - LocalDriver throws FileDoesNotExistException
See forge#110999
Description
The
\TYPO3\
method now throws the specific
\TYPO3\ when the
requested file does not exist. Previously, the global
\Invalid was thrown.
Impact
Extensions that catch
\Invalid when calling
Local will no longer catch the
exception. Code that catches
\TYPO3\
continues to work because
File extends it.
Affected installations
Installations are affected when custom extension code directly or indirectly
calls
Local and catches
\Invalid for missing files.
Migration
Catch
File instead:
use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
try {
$fileInfo = $driver->getFileInfoByIdentifier($identifier);
} catch (FileDoesNotExistException) {
// Handle the missing file.
}
Code that handles missing files and folders alike can catch the parent
Resource instead.