mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
94cb4bf90c
Summary: In D18032458 we introduce getReactApplicationContextIfActiveOrWarn. In this diff, modules that access a JS or Native module through ReactApplicationContext need to check if the CatalystInstance is still alive before continuing. Modules that don't derive from `ReactContextBaseJavaModule` manually check for the catalyst impl and log their own SoftExceptions. In this diff we also introduce SoftExceptions that by contract never cause crashes, even in debug mode. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D18112989 fbshipit-source-id: 868f01f388aa2db3518db9f873f2afc2a62eed45
20 lines
620 B
Java
20 lines
620 B
Java
/*
|
|
* Copyright (c) Facebook, Inc. and its 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 ReactNoCrashSoftException should log it only
|
|
* and not crash, no matter what.
|
|
*/
|
|
public class ReactNoCrashSoftException extends RuntimeException {
|
|
public ReactNoCrashSoftException(String detailMessage) {
|
|
super(detailMessage);
|
|
}
|
|
}
|