[Libreoffice-commits] online.git: net/Ssl.cpp wsd/LOOLWSD.cpp

Jan Holesovsky kendy at collabora.com
Mon Apr 3 09:41:18 UTC 2017


 net/Ssl.cpp     |    8 ++++----
 wsd/LOOLWSD.cpp |    3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit a9389687a416ae8b2fa755a6f473629f35d0bd43
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Apr 3 11:39:09 2017 +0200

    Don't try to clean up after a runtime error.
    
    We don't know in what state we are...
    
    Change-Id: I8d144000ba684ca23ff67977959c95b31de34367

diff --git a/net/Ssl.cpp b/net/Ssl.cpp
index 74f606cf..d6d13575 100644
--- a/net/Ssl.cpp
+++ b/net/Ssl.cpp
@@ -78,7 +78,7 @@ SslContext::SslContext(const std::string& certFilePath,
             if (errCode != 1)
             {
                 std::string msg = getLastErrorMsg();
-                throw std::runtime_error(std::string("Cannot load CA file/directory at ") + caFilePath + ": " + msg);
+                throw std::runtime_error(std::string("Cannot load CA file/directory at ") + caFilePath + " (" + msg + ")");
             }
         }
 
@@ -88,7 +88,7 @@ SslContext::SslContext(const std::string& certFilePath,
             if (errCode != 1)
             {
                 std::string msg = getLastErrorMsg();
-                throw std::runtime_error(std::string("Error loading private key from file ") + keyFilePath + ": " + msg);
+                throw std::runtime_error(std::string("Error loading private key from file ") + keyFilePath + " (" + msg + ")");
             }
         }
 
@@ -97,8 +97,8 @@ SslContext::SslContext(const std::string& certFilePath,
             errCode = SSL_CTX_use_certificate_chain_file(_ctx, certFilePath.c_str());
             if (errCode != 1)
             {
-                std::string errMsg = getLastErrorMsg();
-                throw std::runtime_error(std::string("Error loading certificate from file ") + certFilePath + ": " + errMsg);
+                std::string msg = getLastErrorMsg();
+                throw std::runtime_error(std::string("Error loading certificate from file ") + certFilePath + " (" + msg + ")");
             }
         }
 
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 6b2d633b..a47a3511 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2517,6 +2517,9 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     try {
         returnValue = innerMain();
+    } catch (const std::runtime_error& e) {
+        LOG_FTL(e.what());
+        throw;
     } catch (...) {
         cleanup();
         throw;


More information about the Libreoffice-commits mailing list