mirror of
https://github.com/NixOS/nix.git
synced 2025-12-04 16:10:59 +01: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:
parent
857e380c7d
commit
85b7989764
3 changed files with 8 additions and 4 deletions
|
|
@ -107,8 +107,8 @@ ReadlineLikeInteracter::Guard ReadlineLikeInteracter::init(detail::ReplCompleter
|
|||
rl_readline_name = "nix-repl";
|
||||
try {
|
||||
createDirs(dirOf(historyFile));
|
||||
} catch (std::filesystem::filesystem_error & e) {
|
||||
warn(e.what());
|
||||
} catch (SystemError & e) {
|
||||
logWarning(e.info());
|
||||
}
|
||||
#ifndef USE_READLINE
|
||||
el_hist_size = 1000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue