summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-21 13:42:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-21 17:06:26 +0100
commit2c0c0794a8e287497e460f3f1e6bcba585d675d4 (patch)
tree285e5e4101ccc766a6ddf2bb3ac4e9b95d0ab411 /dbaccess
parent57abe1bb3b56c754db0045a8c55c3a8d3d75803e (diff)
Resolves: tdf#121838 catch exception for missing column
in database migration Change-Id: Ied42d1436f14012fb918e8e6775fcbe0f7d5fac5 Reviewed-on: https://gerrit.libreoffice.org/65546 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/hsqldb/hsqlimport.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index 49d6f978e6b6..b29889c1b6cd 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -338,11 +338,21 @@ void HsqlImporter::importHsqlDatabase(weld::Window* pParent)
// data
for (const auto& tableIndex : parser.getTableIndexes())
{
- std::vector<ColumnDefinition> aColTypes = parser.getTableColumnTypes(tableIndex.first);
try
{
+ std::vector<ColumnDefinition> aColTypes = parser.getTableColumnTypes(tableIndex.first);
parseTableRows(tableIndex.second, aColTypes, tableIndex.first);
}
+ catch (const std::out_of_range& e)
+ {
+ std::unique_ptr<SQLException> ex(new SQLException);
+ const char* msg = e.what();
+ ex->SQLState = OUString(msg, strlen(msg), RTL_TEXTENCODING_ASCII_US);
+ // chain errors and keep going
+ if (pException)
+ ex->NextException <<= *pException;
+ pException = std::move(ex);
+ }
catch (SQLException& ex)
{
// chain errors and keep going