RCTExceptionsManager.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Copyright (c) Facebook, Inc. and its 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. #import <Foundation/Foundation.h>
  8. #import <React/RCTBridgeModule.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol RCTExceptionsManagerDelegate <NSObject>
  11. - (void)handleSoftJSExceptionWithMessage:(nullable NSString *)message stack:(nullable NSArray *)stack exceptionId:(NSNumber *)exceptionId;
  12. - (void)handleFatalJSExceptionWithMessage:(nullable NSString *)message stack:(nullable NSArray *)stack exceptionId:(NSNumber *)exceptionId;
  13. @optional
  14. - (void)updateJSExceptionWithMessage:(nullable NSString *)message stack:(nullable NSArray *)stack exceptionId:(NSNumber *)exceptionId;
  15. @end
  16. @interface RCTExceptionsManager : NSObject <RCTBridgeModule>
  17. - (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate;
  18. - (void)reportSoftException:(nullable NSString *)message stack:(nullable NSArray<NSDictionary *> *)stack exceptionId:(NSNumber *)exceptionId;
  19. - (void)reportFatalException:(nullable NSString *)message stack:(nullable NSArray<NSDictionary *> *)stack exceptionId:(NSNumber *)exceptionId;
  20. @property (nonatomic, weak) id<RCTExceptionsManagerDelegate> delegate;
  21. @property (nonatomic, assign) NSUInteger maxReloadAttempts;
  22. @end
  23. NS_ASSUME_NONNULL_END