1
0
Fork 0
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:
Eelco Dolstra 2013-10-02 14:34:36 +02:00
parent a5fb4b5b7c
commit 28e0742966
2 changed files with 8 additions and 1 deletions

View file

@ -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;