\TYPO3\CMS\Core\Resource\Driver\LocalDriver (TYPO3 v10.4) already
throws that exception class when a file does not exist.
Other extensions like VHS depend on that behavior, because they catch
those exceptions to specifically handle the file-not-found case.
Also mention the name of the missing file in the exception message
to ease debugging.
.. instead of throwing a generic \Exception.
\TYPO3\CMS\Core\Resource\Driver\LocalDriver (TYPO3 v10.4) already throws that exception class when a file does not exist. Other extensions like VHS depend on that behavior, because they catch those exceptions to specifically handle the file-not-found case.
Also mention the name of the missing file in the exception message to ease debugging.
Related: https://github.com/FluidTYPO3/vhs/issues/1725