[Libreoffice-commits] core.git: dbaccess/source

Tamas Bunth tamas.bunth at collabora.co.uk
Thu May 24 09:37:50 UTC 2018


 dbaccess/source/filter/hsqldb/hsqlimport.cxx |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 434ba18afd5ec3e92e2725d649b898e25fcc4813
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Tue May 22 14:21:08 2018 +0200

    tdf117333 dbahsql: Chain SQLExceptions
    
    Change-Id: Ic24d79f39d9cc36cf229c7410e1f96c4c3d316f9
    Reviewed-on: https://gerrit.libreoffice.org/54671
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>

diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index 83b291ccf745..260ec8665d0a 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -305,8 +305,10 @@ void HsqlImporter::importHsqlDatabase()
     }
     catch (SQLException& ex)
     {
-        if (!pException)
-            pException.reset(new SQLException{ ex });
+        // chain errors and keep going
+        if (pException)
+            ex.NextException <<= *pException;
+        pException.reset(new SQLException{ std::move(ex) });
     }
 
     auto statements = parser.getCreateStatements();
@@ -327,8 +329,9 @@ void HsqlImporter::importHsqlDatabase()
         }
         catch (SQLException& ex)
         {
-            if (!pException)
-                pException.reset(new SQLException{ ex });
+            if (pException)
+                ex.NextException <<= *pException;
+            pException.reset(new SQLException{ std::move(ex) });
         }
     }
 
@@ -342,8 +345,9 @@ void HsqlImporter::importHsqlDatabase()
         }
         catch (SQLException& ex)
         {
-            if (!pException)
-                pException.reset(new SQLException{ ex });
+            if (pException)
+                ex.NextException <<= *pException;
+            pException.reset(new SQLException{ std::move(ex) });
         }
     }
 
@@ -357,12 +361,12 @@ void HsqlImporter::importHsqlDatabase()
         }
         catch (SQLException& ex)
         {
-            if (!pException)
-                pException.reset(new SQLException{ ex });
+            if (pException)
+                ex.NextException <<= *pException;
+            pException.reset(new SQLException{ std::move(ex) });
         }
     }
 
-    // show first error occurred
     if (pException)
     {
         SAL_WARN("dbaccess", "Error during migration");


More information about the Libreoffice-commits mailing list