mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Report OOM errors better
This commit is contained in:
parent
a5fb4b5b7c
commit
28e0742966
2 changed files with 8 additions and 1 deletions
|
@ -303,6 +303,9 @@ int main(int argc, char * * argv)
|
|||
if (e.prefix() != "" && !showTrace)
|
||||
printMsg(lvlError, "(use `--show-trace' to show detailed location information)");
|
||||
return e.status;
|
||||
} catch (std::bad_alloc & e) {
|
||||
printMsg(lvlError, "error: out of memory");
|
||||
return 1;
|
||||
} catch (std::exception & e) {
|
||||
printMsg(lvlError, format("error: %1%") % e.what());
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue