1 /* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 */ 7 8 #import <Foundation/Foundation.h> 9 #import <ABI47_0_0React/ABI47_0_0RCTBridgeModule.h> 10 11 NS_ASSUME_NONNULL_BEGIN 12 13 @protocol ABI47_0_0RCTExceptionsManagerDelegate <NSObject> 14 15 - (void)handleSoftJSExceptionWithMessage:(nullable NSString *)message 16 stack:(nullable NSArray *)stack 17 exceptionId:(NSNumber *)exceptionId 18 extraDataAsJSON:(nullable NSString *)extraDataAsJSON; 19 - (void)handleFatalJSExceptionWithMessage:(nullable NSString *)message 20 stack:(nullable NSArray *)stack 21 exceptionId:(NSNumber *)exceptionId 22 extraDataAsJSON:(nullable NSString *)extraDataAsJSON; 23 24 @optional 25 - (void)updateJSExceptionWithMessage:(nullable NSString *)message 26 stack:(nullable NSArray *)stack 27 exceptionId:(NSNumber *)exceptionId; 28 29 @end 30 31 @interface ABI47_0_0RCTExceptionsManager : NSObject <ABI47_0_0RCTBridgeModule> 32 33 - (instancetype)initWithDelegate:(id<ABI47_0_0RCTExceptionsManagerDelegate>)delegate; 34 35 - (void)reportSoftException:(nullable NSString *)message 36 stack:(nullable NSArray<NSDictionary *> *)stack 37 exceptionId:(double)exceptionId; 38 - (void)reportFatalException:(nullable NSString *)message 39 stack:(nullable NSArray<NSDictionary *> *)stack 40 exceptionId:(double)exceptionId; 41 - (void)reportJsException:(NSString *)errorMap; 42 43 @property (nonatomic, weak) id<ABI47_0_0RCTExceptionsManagerDelegate> delegate; 44 45 @property (nonatomic, assign) NSUInteger maxReloadAttempts; 46 47 @end 48 49 NS_ASSUME_NONNULL_END 50