mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a911efaecd
commit
3a5eedffff
@@ -19,8 +19,7 @@ TelemetryController::TelemetryController(
|
||||
bool TelemetryController::pullTransaction(
|
||||
std::function<void(MountingTransactionMetadata metadata)> willMount,
|
||||
std::function<void(ShadowViewMutationList const &mutations)> doMount,
|
||||
std::function<void(MountingTransactionMetadata metadata)> didMount) const
|
||||
noexcept {
|
||||
std::function<void(MountingTransactionMetadata metadata)> didMount) const {
|
||||
auto optional = mountingCoordinator_.pullTransaction();
|
||||
if (!optional.has_value()) {
|
||||
return false;
|
||||
|
||||
@@ -45,8 +45,7 @@ class TelemetryController final {
|
||||
bool pullTransaction(
|
||||
std::function<void(MountingTransactionMetadata metadata)> willMount,
|
||||
std::function<void(ShadowViewMutationList const &mutations)> doMount,
|
||||
std::function<void(MountingTransactionMetadata metadata)> didMount) const
|
||||
noexcept;
|
||||
std::function<void(MountingTransactionMetadata metadata)> didMount) const;
|
||||
|
||||
private:
|
||||
MountingCoordinator const &mountingCoordinator_;
|
||||
|
||||
Reference in New Issue
Block a user