- $backend_class = DI::storageManager()->getSelectableStorageByName($item['backend-class'] ?? '');
- if (!empty($backend_class)) {
- try {
- $backend_class->delete($item['backend-ref'] ?? '');
- } catch (ReferenceStorageException $referenceStorageException) {
- DI::logger()->debug('Item doesn\'t exist.', ['conditions' => $conditions, 'exception' => $referenceStorageException]);
- }
+ try {
+ $backend_class = DI::storageManager()->getWritableStorageByName($item['backend-class'] ?? '');
+ $backend_class->delete($item['backend-ref'] ?? '');
+ } catch (InvalidClassStorageException $storageException) {
+ DI::logger()->debug('Storage class not found.', ['conditions' => $conditions, 'exception' => $storageException]);
+ } catch (ReferenceStorageException $referenceStorageException) {
+ DI::logger()->debug('Item doesn\'t exist.', ['conditions' => $conditions, 'exception' => $referenceStorageException]);