1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

fix: handle errors in nix::createDirs

the `std::filesystem::create_directories` can fail due to insufficient
permissions. We convert this error into a `SysError` and catch it
wherever required.
This commit is contained in:
siddhantCodes 2024-06-20 19:53:25 +05:30
parent 857e380c7d
commit 85b7989764
3 changed files with 8 additions and 4 deletions

View file

@ -1304,7 +1304,7 @@ ref<Store> openStore(StoreReference && storeURI)
if (!pathExists(chrootStore)) {
try {
createDirs(chrootStore);
} catch (std::filesystem::filesystem_error & e) {
} catch (SystemError & e) {
return std::make_shared<LocalStore>(params);
}
warn("'%s' does not exist, so Nix will use '%s' as a chroot store", stateDir, chrootStore);