mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Log softerror when attempting to use ReactInstanceManager in Bridgeless Mode
Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D34060026 fbshipit-source-id: 41441c0b16c4ef0248957eae11d9c9bc642f6d34
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9bc6c0f8a5
commit
f9fa385eb1
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.react.bridge;
|
||||
|
||||
/**
|
||||
* Extends RuntimeException so that it may be caught by a {@link ReactSoftExceptionListener}. Any
|
||||
* {@link ReactSoftExceptionListener} that catches a ReactNoCrashBridgeNotAllowedSoftException
|
||||
* should log it only and not crash, no matter what.
|
||||
*/
|
||||
public class ReactNoCrashBridgeNotAllowedSoftException extends ReactNoCrashSoftException {
|
||||
public ReactNoCrashBridgeNotAllowedSoftException(String m) {
|
||||
super(m);
|
||||
}
|
||||
|
||||
public ReactNoCrashBridgeNotAllowedSoftException(Throwable e) {
|
||||
super(e);
|
||||
}
|
||||
|
||||
public ReactNoCrashBridgeNotAllowedSoftException(String m, Throwable e) {
|
||||
super(m, e);
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,12 @@ public class ReactSoftExceptionLogger {
|
||||
sListeners.clear();
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
public static void logSoftExceptionVerbose(final String category, final Throwable cause) {
|
||||
logSoftException(
|
||||
category + "|" + cause.getClass().getSimpleName() + ":" + cause.getMessage(), cause);
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
public static void logSoftException(final String category, final Throwable cause) {
|
||||
if (sListeners.size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user