| 73 | } |
| 74 | |
| 75 | void LogAndAbortUncaught() { |
| 76 | try { |
| 77 | throw; // rethrow the current unknown |
| 78 | } catch (const tns::NativeScriptException& e) { |
| 79 | // We only have message/stack; no safe ReThrowToJava here. |
| 80 | __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", |
| 81 | "Uncaught NativeScriptException: %s", e.what()); |
| 82 | } catch (const std::exception& e) { |
| 83 | __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", |
| 84 | "Uncaught std::exception: %s", e.what()); |
| 85 | } catch (...) { |
| 86 | __android_log_print(ANDROID_LOG_FATAL, "TNS.Native", |
| 87 | "Uncaught unknown native exception"); |
| 88 | } |
| 89 | |
| 90 | // Preserve default abort behavior so crashes are visible to tooling |
| 91 | std::_Exit(EXIT_FAILURE); |
| 92 | } |
| 93 | |
| 94 | void Runtime::Init(JavaVM* vm, void* reserved) { |
| 95 | __android_log_print(ANDROID_LOG_INFO, "TNS.Runtime", |