mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-09 13:12:42 +00:00
32 lines
1.4 KiB
Diff
32 lines
1.4 KiB
Diff
diff --git a/node_modules/react-native-nitro-modules/cpp/core/HybridFunction.hpp b/node_modules/react-native-nitro-modules/cpp/core/HybridFunction.hpp
|
|
index efcea05..ffad3f2 100644
|
|
--- a/node_modules/react-native-nitro-modules/cpp/core/HybridFunction.hpp
|
|
+++ b/node_modules/react-native-nitro-modules/cpp/core/HybridFunction.hpp
|
|
@@ -23,6 +23,10 @@ struct JSIConverter;
|
|
#include <string>
|
|
#include <type_traits>
|
|
|
|
+#ifdef ANDROID
|
|
+#include <fbjni/fbjni.h>
|
|
+#endif
|
|
+
|
|
namespace margelo::nitro {
|
|
|
|
using namespace facebook;
|
|
@@ -109,6 +113,15 @@ public:
|
|
std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
|
std::string message = exception.what();
|
|
throw jsi::JSError(runtime, funcName + ": " + message);
|
|
+#ifdef ANDROID
|
|
+#pragma clang diagnostic push
|
|
+#pragma clang diagnostic ignored "-Wexceptions"
|
|
+ } catch (const jni::JniException& exception) {
|
|
+ std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|
|
+ std::string message = exception.what();
|
|
+ throw jsi::JSError(runtime, funcName + ": " + message);
|
|
+#pragma clang diagnostic pop
|
|
+#endif
|
|
} catch (...) {
|
|
// Some unknown exception was thrown - add method name information and re-throw as `JSError`.
|
|
std::string funcName = getHybridFuncFullName<THybrid>(kind, name, hybridInstance.get());
|