mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
9a43e53a06
Differential Revision: D40613108 (https://github.com/facebook/react-native/commit/5449148482271d60c87f6e5fa4483e69d4410320) Original commit changeset: f36c3b39a216 Original Phabricator Diff: D40613108 (https://github.com/facebook/react-native/commit/5449148482271d60c87f6e5fa4483e69d4410320) fbshipit-source-id: 079deac137610eeebd231bd97930efda6b284fff
40 lines
868 B
C++
40 lines
868 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include <jsi/jsi.h>
|
|
#include <react/renderer/mapbuffer/MapBuffer.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
enum JSErrorHandlerKey : uint16_t {
|
|
kFrameFileName = 0,
|
|
kFrameMethodName = 1,
|
|
kFrameLineNumber = 2,
|
|
kFrameColumnNumber = 3,
|
|
kAllStackFrames = 4,
|
|
kErrorMessage = 5,
|
|
kExceptionId = 6,
|
|
kIsFatal = 7
|
|
};
|
|
|
|
class JsErrorHandler {
|
|
public:
|
|
using JsErrorHandlingFunc = std::function<void(MapBuffer errorMap)>;
|
|
|
|
JsErrorHandler(JsErrorHandlingFunc jsErrorHandlingFunc);
|
|
~JsErrorHandler();
|
|
|
|
void handleJsError(const jsi::JSError &error, bool isFatal);
|
|
|
|
private:
|
|
JsErrorHandlingFunc _jsErrorHandlingFunc;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|