summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-02-05 15:48:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-06 08:16:38 +0100
commit20c4c3acd5fbf38f2e990435bf346d4fbac05f9d (patch)
tree64aff89ac6aaf94f99fa99bc7e096eb52736deef /connectivity
parentdcc06dee258e04eff0140901d6e2e783ec3e2dd8 (diff)
store originating exception when re-throwing
Change-Id: I26959d3604a581f1528e575239970ab364c7fd50 Reviewed-on: https://gerrit.libreoffice.org/67413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbexception.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx7
-rw-r--r--connectivity/source/drivers/jdbc/JConnection.cxx4
-rw-r--r--connectivity/source/drivers/jdbc/ResultSet.cxx7
4 files changed, 14 insertions, 8 deletions
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
index 718bbdf4d674..31503a724a01 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -400,7 +400,7 @@ void throwGenericSQLException(const OUString& _rMsg, const Reference< XInterface
throw SQLException( _rMsg, _rxSource, getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 0, _rNextException);
}
-void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, const Reference< XInterface >& _rxContext )
+void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, const Reference< XInterface >& _rxContext, const Any& _rNextException )
{
::connectivity::SharedResources aResources;
const OUString sError( aResources.getResourceStringWithSubstitution(
@@ -413,7 +413,7 @@ void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, cons
_rxContext,
getStandardSQLState( StandardSQLState::FEATURE_NOT_IMPLEMENTED ),
0,
- Any()
+ _rNextException
);
}
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 735daf3bc1ab..767f4d99ac99 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1068,12 +1068,12 @@ bool ODbaseTable::CreateImpl()
}
catch(const Exception&)
{
-
+ css::uno::Any anyEx = cppu::getCaughtException();
const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
STR_COULD_NOT_DELETE_FILE,
"$name$", aName
) );
- ::dbtools::throwGenericSQLException( sError, *this );
+ ::dbtools::throwGenericSQLException( sError, *this, anyEx );
}
}
if (!CreateMemoFile(aURL))
@@ -1086,11 +1086,12 @@ bool ODbaseTable::CreateImpl()
}
catch(const ContentCreationException&)
{
+ css::uno::Any anyEx = cppu::getCaughtException();
const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
STR_COULD_NOT_DELETE_FILE,
"$name$", aName
) );
- ::dbtools::throwGenericSQLException( sError, *this );
+ ::dbtools::throwGenericSQLException( sError, *this, anyEx );
}
return false;
}
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
index 8d0dfe141b54..2a1b153b9fd6 100644
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ b/connectivity/source/drivers/jdbc/JConnection.cxx
@@ -701,9 +701,11 @@ void java_sql_Connection::loadDriverFromProperties( const OUString& _sDriverClas
}
catch( Exception& )
{
+ css::uno::Any anyEx = cppu::getCaughtException();
::dbtools::throwGenericSQLException(
lcl_getDriverLoadErrorMessage( getResources(),_sDriverClass, _sDriverClassPath ),
- *this
+ *this,
+ anyEx
);
}
}
diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx
index 97b1f1233e50..238e78702c61 100644
--- a/connectivity/source/drivers/jdbc/ResultSet.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSet.cxx
@@ -35,6 +35,7 @@
#include <comphelper/property.hxx>
#include <connectivity/CommonTools.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/sequence.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <TConnection.hxx>
@@ -729,7 +730,8 @@ void SAL_CALL java_sql_ResultSet::updateBinaryStream( sal_Int32 columnIndex, con
}
catch(const Exception&)
{
- ::dbtools::throwFeatureNotImplementedSQLException( "XRowUpdate::updateBinaryStream", *this );
+ Any anyEx = ::cppu::getCaughtException();
+ ::dbtools::throwFeatureNotImplementedSQLException( "XRowUpdate::updateBinaryStream", *this, anyEx );
}
}
@@ -760,7 +762,8 @@ void SAL_CALL java_sql_ResultSet::updateCharacterStream( sal_Int32 columnIndex,
}
catch(const Exception&)
{
- ::dbtools::throwFeatureNotImplementedSQLException( "XRowUpdate::updateCharacterStream", *this );
+ Any anyEx = ::cppu::getCaughtException();
+ ::dbtools::throwFeatureNotImplementedSQLException( "XRowUpdate::updateCharacterStream", *this, anyEx );
}
}