MCPcopy Create free account
hub / github.com/NativeScript/android / TryGetRuntime

Function TryGetRuntime

test-app/runtime/src/main/cpp/com_tns_Runtime.cpp:110–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110Runtime* TryGetRuntime(int runtimeId) {
111 Runtime* runtime = nullptr;
112 try {
113 runtime = Runtime::GetRuntime(runtimeId);
114 } catch (NativeScriptException& e) {
115 e.ReThrowToJava();
116 } catch (std::exception e) {
117 stringstream ss;
118 ss << "Error: c++ exception: " << e.what() << endl;
119 NativeScriptException nsEx(ss.str());
120 nsEx.ReThrowToJava();
121 } catch (...) {
122 NativeScriptException nsEx(std::string("Error: c++ exception!"));
123 nsEx.ReThrowToJava();
124 }
125 return runtime;
126}
127
128extern "C" JNIEXPORT void Java_com_tns_Runtime_runModule(JNIEnv* _env, jobject obj, jint runtimeId, jstring scriptFile) {
129 auto runtime = TryGetRuntime(runtimeId);

Calls 2

ReThrowToJavaMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected