Catch a broader range of exceptions when creating a ControlConn
authorDavin McCall <davmac@davmac.org>
Sun, 12 Jun 2016 23:21:09 +0000 (00:21 +0100)
committerDavin McCall <davmac@davmac.org>
Sun, 12 Jun 2016 23:21:09 +0000 (00:21 +0100)
src/dinit.cc

index a82f502c69d3f583e4cc75e9cdb91321d31a9384..daaa0a092754898745d5c7c12309345ec844e124 100644 (file)
@@ -444,8 +444,8 @@ static void control_socket_cb(EventLoop_t *loop, int sockfd)
         try {
             new ControlConn(loop, service_set, newfd);  // will delete itself when it's finished
         }
-        catch (std::bad_alloc &bad_alloc_exc) {
-            log(LogLevel::ERROR, "Accepting control connection: Out of memory");
+        catch (std::exception &exc) {
+            log(LogLevel::ERROR, "Accepting control connection: ", exc.what());
             close(newfd);
         }
     }