Kaydet (Commit) e01a142c authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1210000 Uncaught exception

and

coverity#1210001 Uncaught exception

Change-Id: Ia6ef659ba6e62d56813a87c3fcf0fa4a5d26d9f9
üst 763a0d8a
...@@ -107,10 +107,12 @@ void SAL_CALL Connection::release() throw() ...@@ -107,10 +107,12 @@ void SAL_CALL Connection::release() throw()
} }
void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyValue >& info) void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyValue >& info)
throw(SQLException, RuntimeException) throw (SQLException, RuntimeException, std::exception)
{ {
osl_atomic_increment( &m_refCount ); osl_atomic_increment( &m_refCount );
try
{
m_sConnectionURL = url; m_sConnectionURL = url;
bool bIsNewDatabase = false; bool bIsNewDatabase = false;
...@@ -292,6 +294,20 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV ...@@ -292,6 +294,20 @@ void Connection::construct(const ::rtl::OUString& url, const Sequence< PropertyV
else else
assert(false); assert(false);
} }
}
catch (const Exception&)
{
throw;
}
catch (const std::exception&)
{
throw;
}
catch (...) // const Firebird::Exception& firebird throws this, but doesn't install the fb_exception.h that declares it
{
throw std::runtime_error("Generic Firebird::Exception");
}
osl_atomic_decrement( &m_refCount ); osl_atomic_decrement( &m_refCount );
} }
...@@ -788,10 +804,12 @@ uno::Reference< XTablesSupplier > Connection::createCatalog() ...@@ -788,10 +804,12 @@ uno::Reference< XTablesSupplier > Connection::createCatalog()
} }
void Connection::rebuildIndexes() throw (SQLException, RuntimeException) void Connection::rebuildIndexes() throw (SQLException, RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_aMutex); MutexGuard aGuard(m_aMutex);
try
{
// We only need to do this for character based columns on user-created tables. // We only need to do this for character based columns on user-created tables.
// Ideally we'd use a FOR SELECT ... INTO .... DO ..., but that seems to // Ideally we'd use a FOR SELECT ... INTO .... DO ..., but that seems to
...@@ -848,5 +866,19 @@ void Connection::rebuildIndexes() throw (SQLException, RuntimeException) ...@@ -848,5 +866,19 @@ void Connection::rebuildIndexes() throw (SQLException, RuntimeException)
*this); *this);
} }
commit(); commit();
}
catch (const Exception&)
{
throw;
}
catch (const std::exception&)
{
throw;
}
catch (...) // const Firebird::Exception& firebird throws this, but doesn't install the fb_exception.h that declares it
{
throw std::runtime_error("Generic Firebird::Exception");
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -149,7 +149,7 @@ namespace connectivity ...@@ -149,7 +149,7 @@ namespace connectivity
* versions. * versions.
*/ */
void rebuildIndexes() void rebuildIndexes()
throw (css::sdbc::SQLException, css::uno::RuntimeException); throw (css::sdbc::SQLException, css::uno::RuntimeException, std::exception);
void buildTypeInfo() void buildTypeInfo()
throw (css::sdbc::SQLException); throw (css::sdbc::SQLException);
...@@ -176,8 +176,9 @@ namespace connectivity ...@@ -176,8 +176,9 @@ namespace connectivity
virtual void construct( const ::rtl::OUString& url, virtual void construct( const ::rtl::OUString& url,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info)
throw(::com::sun::star::sdbc::SQLException, throw(css::sdbc::SQLException,
::com::sun::star::uno::RuntimeException); css::uno::RuntimeException,
std::exception);
::rtl::OUString getConnectionURL() const {return m_sConnectionURL;} ::rtl::OUString getConnectionURL() const {return m_sConnectionURL;}
bool isEmbedded() const {return m_bIsEmbedded;} bool isEmbedded() const {return m_bIsEmbedded;}
......
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