summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-02 14:34:36 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-02 14:34:36 +0200
commit28e0742966e962f2672f5731ea3612f223bf3283 (patch)
treeedb6e9830ef95ad987fbae1611a9b31752f1eda8 /src/libmain
parenta5fb4b5b7c1688c9b095bc1c278c17c20844302a (diff)
downloadguix-28e0742966e962f2672f5731ea3612f223bf3283.tar.gz
Report OOM errors better
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index ee0dccc9d1..b71bca682b 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -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;