Breaking: #110999 - LocalDriver throws FileDoesNotExistException 

See forge#110999

Description 

The \TYPO3\CMS\Core\Resource\Driver\LocalDriver::getFileInfoByIdentifier() method now throws the specific \TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException when the requested file does not exist. Previously, the global \InvalidArgumentException was thrown.

Impact 

Extensions that catch \InvalidArgumentException when calling LocalDriver::getFileInfoByIdentifier() will no longer catch the exception. Code that catches \TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException continues to work because FileDoesNotExistException extends it.

Affected installations 

Installations are affected when custom extension code directly or indirectly calls LocalDriver::getFileInfoByIdentifier() and catches \InvalidArgumentException for missing files.

Migration 

Catch FileDoesNotExistException instead:

use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;

try {
    $fileInfo = $driver->getFileInfoByIdentifier($identifier);
} catch (FileDoesNotExistException) {
    // Handle the missing file.
}
Copied!

Code that handles missing files and folders alike can catch the parent ResourceDoesNotExistException instead.