mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
fix: catch filesystem_error
thrown by createDirs
This commit is contained in:
parent
25b0242ca6
commit
7a21432e77
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
#include "signals.hh"
|
#include "signals.hh"
|
||||||
#include "users.hh"
|
#include "users.hh"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
@ -1303,7 +1304,7 @@ ref<Store> openStore(StoreReference && storeURI)
|
||||||
if (!pathExists(chrootStore)) {
|
if (!pathExists(chrootStore)) {
|
||||||
try {
|
try {
|
||||||
createDirs(chrootStore);
|
createDirs(chrootStore);
|
||||||
} catch (Error & e) {
|
} catch (std::filesystem::filesystem_error & e) {
|
||||||
return std::make_shared<LocalStore>(params);
|
return std::make_shared<LocalStore>(params);
|
||||||
}
|
}
|
||||||
warn("'%s' does not exist, so Nix will use '%s' as a chroot store", stateDir, chrootStore);
|
warn("'%s' does not exist, so Nix will use '%s' as a chroot store", stateDir, chrootStore);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue