Kaydet (Commit) 434ba18a authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Tamás Bunth

tdf117333 dbahsql: Chain SQLExceptions

Change-Id: Ic24d79f39d9cc36cf229c7410e1f96c4c3d316f9
Reviewed-on: https://gerrit.libreoffice.org/54671Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Bunth <btomi96@gmail.com>
üst 63f5e757
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment