LibreOffice Module connectivity (master) 1
|
#include <dbexception.hxx>
Public Types | |
enum class | TYPE { SQLException , SQLWarning , SQLContext , Undefined } |
Public Member Functions | |
SQLExceptionInfo () | |
SQLExceptionInfo (const css::sdbc::SQLException &_rError) | |
SQLExceptionInfo (const css::sdbc::SQLWarning &_rError) | |
SQLExceptionInfo (const css::sdb::SQLContext &_rError) | |
SQLExceptionInfo (const OUString &_rSimpleErrorMessage) | |
convenience constructor More... | |
SQLExceptionInfo (const css::uno::Any &_rError) | |
void | prepend (const OUString &_rErrorMessage) |
prepends a plain error message to the chain of exceptions More... | |
void | append (TYPE _eType, const OUString &_rErrorMessage, const OUString &_rSQLState=OUString(), const sal_Int32 _nErrorCode=0) |
appends a plain message to the chain of exceptions More... | |
void | doThrow () |
throws (properly typed) the exception contained in the object @precond isValid() returns <TRUE> More... | |
SQLExceptionInfo & | operator= (const css::sdbc::SQLException &_rError) |
SQLExceptionInfo & | operator= (const css::sdbc::SQLWarning &_rError) |
SQLExceptionInfo & | operator= (const css::sdb::SQLContext &_rError) |
SQLExceptionInfo & | operator= (const css::sdb::SQLErrorEvent &_rErrorEvent) |
SQLExceptionInfo & | operator= (const css::uno::Any &_rCaughtSQLException) |
bool | isKindOf (TYPE _eType) const |
bool | isValid () const |
TYPE | getType () const |
operator const css::sdbc::SQLException * () const | |
operator const css::sdb::SQLContext * () const | |
const css::uno::Any & | get () const |
void | clear () |
Static Public Member Functions | |
static css::uno::Any | createException (TYPE eType, const OUString &rErrorMessage, const OUString &rSQLState, const sal_Int32 nErrorCode) |
static css::sdbc::SQLException * | getLastException (css::sdbc::SQLException *pLastException) |
Private Member Functions | |
void | implDetermineType () |
Private Attributes | |
css::uno::Any | m_aContent |
TYPE | m_eType |
Definition at line 56 of file dbexception.hxx.
|
strong |
Enumerator | |
---|---|
SQLException | |
SQLWarning | |
SQLContext | |
Undefined |
Definition at line 59 of file dbexception.hxx.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | ) |
Definition at line 40 of file dbexception.cxx.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | const css::sdbc::SQLException & | _rError | ) |
Definition at line 46 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | const css::sdbc::SQLWarning & | _rError | ) |
Definition at line 53 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | const css::sdb::SQLContext & | _rError | ) |
Definition at line 60 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | const OUString & | _rSimpleErrorMessage | ) |
convenience constructor
If your error processing relies on SQLExceptions, and SQLExceptionInfos, you still may need to display an error which consists of a simple message string only. In those cases, you can use this constructor, which behaves as if you would have used an SQLException containing exactly the given error message.
Definition at line 67 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
dbtools::SQLExceptionInfo::SQLExceptionInfo | ( | const css::uno::Any & | _rError | ) |
Definition at line 115 of file dbexception.cxx.
References cppu::UnoType< typename T >::get(), implDetermineType(), isAssignableFrom(), and m_aContent.
void dbtools::SQLExceptionInfo::append | ( | TYPE | _eType, |
const OUString & | _rErrorMessage, | ||
const OUString & | _rSQLState = OUString() , |
||
const sal_Int32 | _nErrorCode = 0 |
||
) |
appends a plain message to the chain of exceptions
_eType | the type of exception to append. Must be SQL_EXCEPTION, SQL_WARNING, SQL_CONTEXT, for all other values, the behavior is undefined. |
_rErrorMessage | the message to append |
_rSQLState | the SQLState of the exception to append |
_nErrorCode | the error code of the exception to append |
Definition at line 232 of file dbexception.cxx.
References Any, createException(), getLastException(), m_aContent, and m_eType.
|
inline |
Definition at line 128 of file dbexception.hxx.
References m_aContent, and m_eType.
|
static |
Definition at line 191 of file dbexception.cxx.
References Any, eType, SQLContext, SQLException, SQLWarning, and TOOLS_WARN_EXCEPTION.
Referenced by append().
void dbtools::SQLExceptionInfo::doThrow | ( | ) |
throws (properly typed) the exception contained in the object @precond isValid() returns <TRUE>
SQLException | |
RuntimeException | if the instance does not contain an SQLException |
Definition at line 250 of file dbexception.cxx.
References m_aContent.
|
inline |
Definition at line 126 of file dbexception.hxx.
References m_aContent.
Referenced by dbtools::showError().
|
static |
Definition at line 219 of file dbexception.cxx.
Referenced by append().
|
inline |
Definition at line 121 of file dbexception.hxx.
References m_eType.
Referenced by dbtools::SQLExceptionIteratorHelper::SQLExceptionIteratorHelper().
|
private |
Definition at line 127 of file dbexception.cxx.
References cppu::UnoType< typename T >::get(), isAssignableFrom(), m_aContent, m_eType, SQLContext, SQLException, SQLWarning, and Undefined.
Referenced by operator=(), and SQLExceptionInfo().
bool dbtools::SQLExceptionInfo::isKindOf | ( | TYPE | _eType | ) | const |
Definition at line 147 of file dbexception.cxx.
References m_eType, SQLContext, SQLException, SQLWarning, and Undefined.
|
inline |
Definition at line 120 of file dbexception.hxx.
References m_eType.
Referenced by dbtools::showError(), and dbtools::SQLExceptionIteratorHelper::SQLExceptionIteratorHelper().
dbtools::SQLExceptionInfo::operator const css::sdb::SQLContext * | ( | ) | const |
Definition at line 171 of file dbexception.cxx.
References m_aContent.
dbtools::SQLExceptionInfo::operator const css::sdbc::SQLException * | ( | ) | const |
Definition at line 164 of file dbexception.cxx.
References m_aContent.
SQLExceptionInfo & dbtools::SQLExceptionInfo::operator= | ( | const css::sdb::SQLContext & | _rError | ) |
Definition at line 91 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
SQLExceptionInfo & dbtools::SQLExceptionInfo::operator= | ( | const css::sdb::SQLErrorEvent & | _rErrorEvent | ) |
Definition at line 99 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
SQLExceptionInfo & dbtools::SQLExceptionInfo::operator= | ( | const css::sdbc::SQLException & | _rError | ) |
Definition at line 75 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
SQLExceptionInfo & dbtools::SQLExceptionInfo::operator= | ( | const css::sdbc::SQLWarning & | _rError | ) |
Definition at line 83 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
SQLExceptionInfo & dbtools::SQLExceptionInfo::operator= | ( | const css::uno::Any & | _rCaughtSQLException | ) |
Definition at line 107 of file dbexception.cxx.
References implDetermineType(), and m_aContent.
void dbtools::SQLExceptionInfo::prepend | ( | const OUString & | _rErrorMessage | ) |
prepends a plain error message to the chain of exceptions
_rSimpleErrorMessage | the error message to prepend |
Definition at line 178 of file dbexception.cxx.
References m_aContent, m_eType, and SQLException.
|
private |
Definition at line 62 of file dbexception.hxx.
Referenced by append(), doThrow(), implDetermineType(), operator=(), prepend(), and SQLExceptionInfo().
|
private |
Definition at line 63 of file dbexception.hxx.
Referenced by append(), implDetermineType(), isKindOf(), and prepend().