1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 18:01:16 +02:00

Merge pull request #11378 from Mic92/nix-dir-errors

builtins.readDir: fix nix error trace on filesystem errors
This commit is contained in:
John Ericson 2024-09-11 13:10:28 -04:00 committed by GitHub
commit db7c868d24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 92 additions and 40 deletions

View file

@ -0,0 +1,14 @@
---
synopsis: wrap filesystem exceptions more correctly
issues: []
prs: [11378]
---
With the switch to `std::filesystem` in different places, Nix started to throw `std::filesystem::filesystem_error` in many places instead of its own exceptions.
This lead to no longer generating error traces, for example when listing a non-existing directory, and can also lead to crashes inside the Nix REPL.
This version catches these types of exception correctly and wrap them into Nix's own exeception type.
Author: [**@Mic92**](https://github.com/Mic92)