Skip to content

Commit b3f84c5

Browse files
Roman HaninRoman Hanin
authored andcommitted
B2B-1610: Upgrade to Flysystem 2.0
- review notes fix.
1 parent 70ff74c commit b3f84c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
namespace Magento\RemoteStorage\Driver\Adapter;
99

1010
use League\Flysystem\FilesystemAdapter;
11+
use League\Flysystem\FilesystemException;
12+
use League\Flysystem\UnableToRetrieveMetadata;
1113
use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface;
1214

1315
/**
@@ -48,7 +50,11 @@ public function getMetadata(string $path): array
4850
if ($metadata && is_array($metadata) && ($metadata['type'] == 'dir' || $this->isMetadataComplete($metadata))) {
4951
return $metadata;
5052
}
51-
$meta = $this->adapter->lastModified($path);
53+
try {
54+
$meta = $this->adapter->lastModified($path);
55+
} catch (\InvalidArgumentException | FilesystemException $e) {
56+
throw UnableToRetrieveMetadata::lastModified($path, $e->getMessage(), $e);
57+
}
5258
$data = [
5359
'path' => $path,
5460
'type' => $meta->type(),

0 commit comments

Comments
 (0)