Issue Bug Closed

#92847SimpleFileBackend throws warning in TYPO3 log

Timo Poppinga 11/16/20, 11:48 updated 02/23/21, 13:13

Description

Core: Error handler (FE): PHP Warning: unlink(xxxx/var/cache/data/api_response/c45c05cd99a7d3ce56692bddece2b1f7): No such file or directory in /xxx/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php line 292

The reason is:

try {
    unlink($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension);
} catch (\Exception $e) {
    return false;
}

The source is catching the error but not the warning if the file dose not exist.
A simple check if the file exists will help.

Reviews 3