File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
app/code/Magento/RemoteStorage/Driver/Adapter Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 10
10
use League \Flysystem \FilesystemAdapter ;
11
11
use League \Flysystem \FilesystemException ;
12
12
use League \Flysystem \UnableToRetrieveMetadata ;
13
+ use Magento \AwsS3 \Driver \AwsS3 ;
13
14
use Magento \RemoteStorage \Driver \Adapter \Cache \CacheInterface ;
14
15
15
16
/**
@@ -47,13 +48,19 @@ public function __construct(
47
48
public function getMetadata (string $ path ): array
48
49
{
49
50
$ metadata = $ this ->cache ->getMetadata ($ path );
50
- if ($ metadata && is_array ($ metadata ) && ($ metadata ['type ' ] == 'dir ' || $ this ->isMetadataComplete ($ metadata ))) {
51
+ if ($ metadata && is_array ($ metadata )
52
+ && ($ metadata ['type ' ] == AwsS3::TYPE_DIR || $ this ->isMetadataComplete ($ metadata ))
53
+ ) {
51
54
return $ metadata ;
52
55
}
53
56
try {
54
57
$ meta = $ this ->adapter ->lastModified ($ path );
55
58
} catch (\InvalidArgumentException | FilesystemException $ e ) {
56
- throw UnableToRetrieveMetadata::lastModified ($ path , $ e ->getMessage (), $ e );
59
+ throw new UnableToRetrieveMetadata (
60
+ "Unable to retrieve metadata for file at location: {$ path }. {$ e ->getMessage ()}" ,
61
+ 0 ,
62
+ $ e
63
+ );
57
64
}
58
65
$ data = [
59
66
'path ' => $ path ,
You can’t perform that action at this time.
0 commit comments