[TYPO3-dev] FAL DriverInterface: How to handle missing files?

Christian Weiske christian.weiske at netresearch.de
Tue Jan 20 11:23:01 CET 2015


Hi,


TYPO3\CMS\Core\Resource\Driver\DriverInterface defines a lot of methods
that a FAL driver has to implement, but does not really specify how to
handle files that do not exist.

Client code can check if a file exists, but in reality other functions
like getFileInfoByIdentifier() or getPublicUrl() are called without
prior checking if the file exists.
The code then breaks, showing the trace of an unhandled exception.

Currently our driver throws an exception if the methods are
called with non-existing file as parameter, but that breaks both
frontend and backend.

Is throwing an exception the correct way?
Or is the driver supposed to return the type as specified in the
"@return" annotation, but with empty data (e.g. and empty array on
"@return array")?

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-= Geeking around in the name of science since 1982 =-




More information about the TYPO3-dev mailing list