[Libreoffice-commits] online.git: net/Socket.hpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Apr 3 05:15:17 UTC 2017


 net/Socket.hpp |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 6e596d11f3ebe09ad1b50c395f920b591805f4b6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Apr 2 19:56:13 2017 -0400

    wsd: catch exceptions from callbacks and wakup hook
    
    Change-Id: Ib4579a34c91cfe43e5bd7038b175175a9ab0036a
    Reviewed-on: https://gerrit.libreoffice.org/36033
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/net/Socket.hpp b/net/Socket.hpp
index 200c389b..e3d9569d 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -377,9 +377,27 @@ public:
             }
 
             for (size_t i = 0; i < invoke.size(); ++i)
-                invoke[i]();
+            {
+                try
+                {
+                    invoke[i]();
+                }
+                catch (const std::exception& exc)
+                {
+                    LOG_ERR("Exception while invoking poll [" << _name <<
+                            "] callback: " << exc.what());
+                }
+            }
 
-            wakeupHook();
+            try
+            {
+                wakeupHook();
+            }
+            catch (const std::exception& exc)
+            {
+                LOG_ERR("Exception while invoking poll [" << _name <<
+                        "] wakeup hook: " << exc.what());
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list