Laravel:文件在路径.../缓存中不存在

Geo*_*tin 3 caching laravel

完整错误:

Exception has occurred.
Illuminate\Contracts\Filesystem\FileNotFoundException: File does not exist at path D:\Projects\shop\back-end\storage\framework/cache/data/9c/1c/9c1c01dc3ac1445a500251fc34a15d3e75a849df
Run Code Online (Sandbox Code Playgroud)

我试过 php artisan cache:clear, php artisan config:cache。没有结果..

小智 6

如果您使用Cache::has()这种预期行为访问缓存存储。Deep downCache::has()将尝试访问预期的位置,FileNotFoundException如果该位置不存在,则会抛出一个。(来源)

Illuminate\Cache\FileStore此异常被捕获并转换为空负载。(来源)

一些调试工具,如 XDebug,会在FileNotFoundException您可以认为是误报时停止。

  • 嗯,是的,在 VSCode 中,如果您在“调试”面板的“断点”部分取消选中“所有内容”或特别是“异常”,您将不会在任何异常上看到任何断点 - 这不是最好的解决方案,但会有所帮助。我无法找到仅阻止特定异常的方法。 (7认同)