Kaydet (Commit) c67fedbd authored tarafından Stephan Bergmann's avatar Stephan Bergmann

To ease debugging, display printStackTrace of caught exceptions in jdbc driver

Change-Id: I8c48b09fcab18af196a8441351bcf3180a32005b
üst 93a0d9ee
...@@ -180,6 +180,9 @@ namespace ...@@ -180,6 +180,9 @@ namespace
else if ( _pEnvironment->IsInstanceOf( jThrow, java_lang_Throwable::st_getMyClass() ) ) else if ( _pEnvironment->IsInstanceOf( jThrow, java_lang_Throwable::st_getMyClass() ) )
{ {
::std::auto_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) ); ::std::auto_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) );
#if OSL_DEBUG_LEVEL > 0
pThrow->printStackTrace();
#endif
::rtl::OUString sMessage = pThrow->getMessage(); ::rtl::OUString sMessage = pThrow->getMessage();
if ( sMessage.isEmpty() ) if ( sMessage.isEmpty() )
sMessage = pThrow->getLocalizedMessage(); sMessage = pThrow->getLocalizedMessage();
......
...@@ -54,7 +54,13 @@ jclass java_lang_Throwable::st_getMyClass() ...@@ -54,7 +54,13 @@ jclass java_lang_Throwable::st_getMyClass()
static jmethodID mID(NULL); static jmethodID mID(NULL);
return callStringMethod("getLocalizedMessage",mID); return callStringMethod("getLocalizedMessage",mID);
} }
// -----------------------------------------------------------------------------
#if OSL_DEBUG_LEVEL > 0
void java_lang_Throwable::printStackTrace() const
{
static jmethodID mID(NULL);
return callVoidMethod("printStackTrace",mID);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -39,6 +39,10 @@ namespace connectivity ...@@ -39,6 +39,10 @@ namespace connectivity
::rtl::OUString getMessage() const; ::rtl::OUString getMessage() const;
::rtl::OUString getLocalizedMessage() const; ::rtl::OUString getLocalizedMessage() const;
#if OSL_DEBUG_LEVEL > 0
void printStackTrace() const;
#endif
static jclass st_getMyClass(); static jclass st_getMyClass();
}; };
} }
......
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