MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / ExceptionCheck

Function ExceptionCheck

Source/3rdParty/SDL2/src/hidapi/android/hid.cpp:395–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395static void ExceptionCheck( JNIEnv *env, const char *pszClassName, const char *pszMethodName )
396{
397 if ( env->ExceptionCheck() )
398 {
399 // Get our exception
400 jthrowable jExcept = env->ExceptionOccurred();
401
402 // Clear the exception so we can call JNI again
403 env->ExceptionClear();
404
405 // Get our exception message
406 jclass jExceptClass = env->GetObjectClass( jExcept );
407 jmethodID jMessageMethod = env->GetMethodID( jExceptClass, "getMessage", "()Ljava/lang/String;" );
408 jstring jMessage = (jstring)( env->CallObjectMethod( jExcept, jMessageMethod ) );
409 const char *pszMessage = env->GetStringUTFChars( jMessage, NULL );
410
411 // ...and log it.
412 LOGE( "%s%s%s threw an exception: %s",
413 pszClassName ? pszClassName : "",
414 pszClassName ? "::" : "",
415 pszMethodName, pszMessage );
416
417 // Cleanup
418 env->ReleaseStringUTFChars( jMessage, pszMessage );
419 env->DeleteLocalRef( jMessage );
420 env->DeleteLocalRef( jExceptClass );
421 env->DeleteLocalRef( jExcept );
422 }
423}
424
425class CHIDDevice
426{

Callers 7

ExceptionCheckMethod · 0.85
BOpenMethod · 0.85
SendOutputReportMethod · 0.85
SendFeatureReportMethod · 0.85
GetFeatureReportMethod · 0.85
CloseMethod · 0.85
hid_initFunction · 0.85

Calls 1

ExceptionCheckMethod · 0.80

Tested by

no test coverage detected