diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-21 13:58:44 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-21 13:58:44 +0000 |
commit | 0d1a524149d541e0095b41435e83bfdd6da2b9ad (patch) | |
tree | 985bc41b9fb101b377d3e3af9437a680f29e4304 /connectivity/source/commontools | |
parent | 6f120164ede32b4287ee13a51f39140b339fbe60 (diff) |
INTEGRATION: CWS dba24c (1.20.20); FILE MERGED
2007/09/18 20:05:13 fs 1.20.20.3: during #i81095#: outsourced the CYCLIC_SUB_QUERIES error to the new css.sdb.ErrorCondition
2007/09/18 12:52:08 fs 1.20.20.2: doThrow: there is a ::cppu::throwException, which is much better than our self-made solution
2007/09/13 11:43:57 fs 1.20.20.1: better grammar in throwFunctionNotSupportedException
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/dbexception.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index b5a87a7638a1..8b7bb6cfc65d 100644 --- a/connectivity/source/commontools/dbexception.cxx +++ b/connectivity/source/commontools/dbexception.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dbexception.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: rt $ $Date: 2007-07-24 11:49:40 $ + * last change: $Author: ihi $ $Date: 2007-11-21 14:58:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,6 +42,9 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _CPPUHELPER_EXC_HLP_HXX_ +#include <cppuhelper/exc_hlp.hxx> +#endif #ifndef _OSL_DIAGNOSE_H_ #include <osl/diagnose.h> #endif @@ -296,13 +299,9 @@ void SQLExceptionInfo::append( TYPE _eType, const ::rtl::OUString& _rErrorMessag //------------------------------------------------------------------------------ void SQLExceptionInfo::doThrow() { - switch ( m_eType ) - { - case SQL_EXCEPTION: throw *(const SQLException*)(*this); - case SQL_WARNING: throw *(const SQLWarning*)(*this); - case SQL_CONTEXT: throw *(const SQLContext*)(*this); - default: throw RuntimeException(); - } + if ( m_aContent.getValueTypeClass() == TypeClass_EXCEPTION ) + ::cppu::throwException( m_aContent ); + throw RuntimeException(); } //============================================================================== @@ -455,7 +454,8 @@ void throwFunctionNotSupportedException(const ::rtl::OUString& _rMsg, void throwFunctionNotSupportedException( const sal_Char* _pAsciiFunctionName, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext, const ::com::sun::star::uno::Any* _pNextException ) throw ( ::com::sun::star::sdbc::SQLException ) { - ::rtl::OUString sMessage = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Driver does not support this function: " ) ); + ::rtl::OUString sMessage = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The driver does not support this function: " ) ); + // TODO: resource sMessage += ::rtl::OUString::createFromAscii( _pAsciiFunctionName ); throw SQLException( sMessage, @@ -555,8 +555,6 @@ const sal_Char* getStandardSQLStateAscii( StandardSQLState _eState ) case SQL_FUNCTION_NOT_SUPPORTED: pAsciiState = "IM001"; break; case SQL_CONNECTION_DOES_NOT_EXIST: pAsciiState = "08003"; break; - // OOoBase-specific SQLStates - case SQL_CYCLIC_SUB_QUERIES: pAsciiState = "OB001"; break; default: break; } |