[9.x] Catch permission exception when creating directory (#41871)
[9.x] Catch permission exception when creating directory (#41871)

* Catch permission exception when creating directory

* Catch permission exception when writing files
leo108/laravel_framework,lucasmichot/framework,laravel/framework,JamesForks/framework,lucasmichot/framework,morrislaptop/framework,laravel/framework,morrislaptop/framework,JamesForks/framework,leo108/laravel_framework,hafezdivandari/framework,arturock/framework,driesvints/framework,arturock/framework,arturock/framework,driesvints/framework,hafezdivandari/framework