- 🇮🇳India mohit_aghera Rajkot
This seems to have been refactored and we are checking if file exists based on wrapper.
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/file/...
Following is the latest code:if (!file_exists($file->getFileUri())) { if (!$this->streamWrapperManager->isValidUri($file->getFileUri())) { $this->logger->warning('Temporary file "%path" that was deleted during garbage collection did not exist on the filesystem. This could be caused by a missing stream wrapper.', ['%path' => $file->getFileUri()]); } else { $this->logger->warning('Temporary file "%path" that was deleted during garbage collection did not exist on the filesystem.', ['%path' => $file->getFileUri()]); } } // Delete the file entity. If the file does not exist, this will // generate a second notice in the watchdog. $file->delete();
Here if file doesn't exist, we are adding errors in the log.
Do we explicitly need to add a new try-catch now?