From 3a5eedfffffacac28eb2cdbaba54b94e224917fa Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 23 Oct 2020 02:31:10 -0700 Subject: [PATCH] Remove noexcept from TelemetryController Summary: Changelog: [internal] There are two exceptions inside `TelemetryController::pullTransaction`: - Empty Optional cannot be unwrapped - mutex lock failed: Invalid argument By marking this method `noexcept`, stack trace is lost and it makes it more difficult to track down the issue. What does compiler do if a method is marked `noexcept`? ``` void f() noexcept { try { // do work } catch (...) { std::terminate(); // This is the std::terminate() we are seeing in stack traces. } } ``` Removing noexcept specifier might give us more information about the exception. Reviewed By: JoshuaGross Differential Revision: D24477861 fbshipit-source-id: 80f26e9ab160a5330c2848b89a01d60bfc0a4611 --- ReactCommon/react/renderer/mounting/TelemetryController.cpp | 3 +-- ReactCommon/react/renderer/mounting/TelemetryController.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ReactCommon/react/renderer/mounting/TelemetryController.cpp b/ReactCommon/react/renderer/mounting/TelemetryController.cpp index a39989cb69d..b058bebcae8 100644 --- a/ReactCommon/react/renderer/mounting/TelemetryController.cpp +++ b/ReactCommon/react/renderer/mounting/TelemetryController.cpp @@ -19,8 +19,7 @@ TelemetryController::TelemetryController( bool TelemetryController::pullTransaction( std::function willMount, std::function doMount, - std::function didMount) const - noexcept { + std::function didMount) const { auto optional = mountingCoordinator_.pullTransaction(); if (!optional.has_value()) { return false; diff --git a/ReactCommon/react/renderer/mounting/TelemetryController.h b/ReactCommon/react/renderer/mounting/TelemetryController.h index 3532072a155..c0b3d28ddd2 100644 --- a/ReactCommon/react/renderer/mounting/TelemetryController.h +++ b/ReactCommon/react/renderer/mounting/TelemetryController.h @@ -45,8 +45,7 @@ class TelemetryController final { bool pullTransaction( std::function willMount, std::function doMount, - std::function didMount) const - noexcept; + std::function didMount) const; private: MountingCoordinator const &mountingCoordinator_;