Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError - assuming FileAttributes but could be Directory #11

Closed
jgivoni opened this issue Jan 18, 2024 · 1 comment · Fixed by #12
Closed

TypeError - assuming FileAttributes but could be Directory #11

jgivoni opened this issue Jan 18, 2024 · 1 comment · Fixed by #12

Comments

@jgivoni
Copy link
Owner

jgivoni commented Jan 18, 2024

2024-01-18T09:03:53.688727445Z stderr F TypeError: jgivoni\Flysystem\Cache\CacheAdapter::jgivoni\Flysystem\Cache\
{closure}(): Argument #1 ($fileAttributes) must be of type League\Flysystem\FileAttributes, 
League\Flysystem\DirectoryAttributes given, called in /app/vendor/jgivoni/flysystem-cache-
adapter/src/CacheItemsTrait.php on line 149 in /app/vendor/jgivoni/flysystem-cache-adapter/src/CacheAdapter.php:269

@jgivoni
Copy link
Owner Author

jgivoni commented Jan 18, 2024

Throw runtime exception in CacheItemsTrait::getFileAttributes and catch it in each of the attribute accessors in CacheAdapter, then convert it to the appropriate exception.
Create unit tests for errors in each accessor method. Expect exception on file not found, path is folder (cached) and path is folder (non-cached).

@jgivoni jgivoni linked a pull request Jan 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant