react-native/ReactCommon/exceptions/ExceptionManager.h
Kevin Gozali f42b5892a1 iOS C++: Add ICxxExceptionManager to access RCTExceptionsManager native module
Summary: It is sometimes useful to report soft/fatal errors from C++ (native) to the same RCTExceptionsManager that is already handling JS exceptions. `ICxxExceptionManager` is an approach to provide such access, which impl provided for ObjC++.

Reviewed By: shergin

Differential Revision: D7224944

fbshipit-source-id: 8c607226b67851d46f4c787f5b6e6c8cb6a1afea
2018-03-19 00:06:57 -07:00

25 lines
595 B
C++

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <exception>
namespace facebook {
namespace react {
/**
* An abstract class for C++-based exception handling that differentiates
* soft exceptions from fatal exceptions.
*/
class ExceptionManager {
public:
virtual void handleSoftException(const std::exception &e) const = 0;
virtual void handleFatalException(const std::exception &e) const = 0;
};
} // namespace react
} // namespace facebook