summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-05-22 14:21:08 +0200
committerTamás Bunth <btomi96@gmail.com>2018-05-24 11:37:29 +0200
commit434ba18afd5ec3e92e2725d649b898e25fcc4813 (patch)
tree18d00c2cf5fce820955041c348cc1a1b922990b0 /dbaccess
parent63f5e757a0453be7a343d74d54f7e61a9070a373 (diff)
tdf117333 dbahsql: Chain SQLExceptions
Change-Id: Ic24d79f39d9cc36cf229c7410e1f96c4c3d316f9 Reviewed-on: https://gerrit.libreoffice.org/54671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.cxx22
1 files changed, 13 insertions, 9 deletions
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");