diff options
author | Oliver Bolte <obo@openoffice.org> | 2007-01-25 10:00:45 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2007-01-25 10:00:45 +0000 |
commit | 56024e689dda1c73bbaaca6dba522104f9cf3310 (patch) | |
tree | 9b9a041c00fb4f04758d8ea889c324d8750bb023 /connectivity | |
parent | 08d1e7614718b620437f647693cfdad5b2752b9f (diff) |
INTEGRATION: CWS calc41 (1.100.28); FILE MERGED
2007/01/12 14:46:53 er 1.100.28.1: #i72457# UpdateBuffer: pass original error in exception
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 38c89805052e..03c19fe7467b 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -4,9 +4,9 @@ * * $RCSfile: DTable.cxx,v $ * - * $Revision: 1.100 $ + * $Revision: 1.101 $ * - * last change: $Author: kz $ $Date: 2006-12-13 16:16:24 $ + * last change: $Author: obo $ $Date: 2007-01-25 11:00:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -109,6 +109,9 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _CPPUHELPER_EXC_HLP_HXX_ +#include <cppuhelper/exc_hlp.hxx> +#endif #ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_ #include "connectivity/PColumn.hxx" #endif @@ -1563,7 +1566,8 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const } sal_Bool bHadError = sal_False; - sal_Bool bCharacterConversionError = sal_False; + sal_Int32 nErrorCode = 1000; + ::rtl::OUString sSQLState = ::dbtools::getStandardSQLState( SQL_GENERAL_ERROR ); Any aSQLError; try { @@ -1660,7 +1664,13 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const break; } } - catch( SQLException& e ) { aSQLError <<= e; bHadError = sal_True; bCharacterConversionError = ( e.ErrorCode == 22018 ); } + catch( SQLException& e ) + { + aSQLError = ::cppu::getCaughtException(); + bHadError = sal_True; + nErrorCode = e.ErrorCode; + sSQLState = e.SQLState; + } catch ( Exception& ) { bHadError = sal_True; } if ( bHadError ) @@ -1674,13 +1684,7 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const sMsg += aColName; sMsg += ::rtl::OUString::createFromAscii("'"); - throw SQLException( - sMsg, - *this, - bCharacterConversionError ? ::rtl::OUString::createFromAscii( "22018" ) : ::dbtools::getStandardSQLState( SQL_GENERAL_ERROR ), - bCharacterConversionError ? 22018 : 1000, - aSQLError - ); + throw SQLException( sMsg, *this, sSQLState, nErrorCode, aSQLError ); } // Und weiter ... nByteOffset += nLen; |