From 2ec9e0c6904f760c841d043d55c2af94d17747ab Mon Sep 17 00:00:00 2001 From: Chris Hopman Date: Fri, 20 May 2016 18:51:26 -0700 Subject: [PATCH] Stop catching exceptions in the cxx bridge Reviewed By: mhorowitz Differential Revision: D3186631 fbshipit-source-id: 5664897b82277159c2b74b289f9a5d416633e243 --- ReactCommon/bridge/ModuleRegistry.cpp | 32 +-------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/ReactCommon/bridge/ModuleRegistry.cpp b/ReactCommon/bridge/ModuleRegistry.cpp index 6cd6671c1..adfdf1dbc 100644 --- a/ReactCommon/bridge/ModuleRegistry.cpp +++ b/ReactCommon/bridge/ModuleRegistry.cpp @@ -104,37 +104,7 @@ void ModuleRegistry::callNativeMethod(ExecutorToken token, unsigned int moduleId } #endif - // TODO mhorowitz: systrace - std::string what; - try { - modules_[moduleId]->invoke(token, methodId, std::move(params)); - return; - } catch (const std::exception& e) { - what = e.what(); - // fall through; - } catch (...) { - // fall through; - } - - std::string moduleName = normalizeName(modules_[moduleId]->getName()); - auto descs = modules_[moduleId]->getMethods(); - std::string methodName; - if (methodId < descs.size()) { - methodName = descs[methodId].name; - } else { - methodName = folly::to("id ", methodId, " (out of range [0..", - descs.size(), "))"); - } - - if (what.empty()) { - throw std::runtime_error( - folly::to("Unknown native exception in module '", moduleName, - "' method '", methodName, "'")); - } else { - throw std::runtime_error( - folly::to("Native exception in module '", moduleName, - "' method '", methodName, "': ", what)); - } + modules_[moduleId]->invoke(token, methodId, std::move(params)); } MethodCallResult ModuleRegistry::callSerializableNativeHook(ExecutorToken token, unsigned int moduleId, unsigned int methodId, folly::dynamic&& params) {