MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / throwException

Function throwException

tensorflow/java/src/main/native/exception_jni.cc:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 "java/lang/UnsupportedOperationException";
29
30void throwException(JNIEnv* env, const char* clazz, const char* fmt, ...) {
31 va_list args;
32 va_start(args, fmt);
33 // Using vsnprintf() instead of vasprintf() because the latter doesn't seem to
34 // be easily available on Windows.
35 const size_t max_msg_len = 512;
36 char* message = static_cast<char*>(malloc(max_msg_len));
37 if (vsnprintf(message, max_msg_len, fmt, args) >= 0) {
38 env->ThrowNew(env->FindClass(clazz), message);
39 } else {
40 env->ThrowNew(env->FindClass(clazz), "");
41 }
42 free(message);
43 va_end(args);
44}
45
46namespace {
47// Map TF_Codes to unchecked exceptions.

Calls

no outgoing calls

Tested by

no test coverage detected