MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / ThrowIf

Function ThrowIf

extensions/jni/JavaException.h:90–98  ·  view source on GitHub ↗

* Static function to throw the exception if one exists within the ENV. * @param env Requires an environment to check */

Source from the content-addressed store, hash-verified

88 * @param env Requires an environment to check
89 */
90static inline void ThrowIf(JNIEnv *env) {
91 jthrowable throwable = env->ExceptionOccurred();
92 if (UNLIKELY(throwable != nullptr)) { // we have faith maybe it won't happen!
93 env->ExceptionClear();
94 auto message = getMessage(env, throwable);
95 env->ThrowNew(env->FindClass(EXCEPTION_CLASS), message.c_str());
96 throw JavaException(message);
97 }
98}
99
100static inline void ThrowJava(JNIEnv *env, const char *message) {
101 env->ExceptionClear();

Calls 3

getMessageFunction · 0.85
JavaExceptionClass · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected