mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-09 22:43:10 +08:00
Reverted commit D3428952
Reviewed By: frantic Differential Revision: D3428952 fbshipit-source-id: 61e5195399746d6511719971121c7c63f87ef4f4
This commit is contained in:
committed by
Facebook Github Bot 0
parent
a8011bbfdc
commit
88bd5e4d90
@@ -79,7 +79,6 @@ import com.facebook.react.modules.debug.DeveloperSettings;
|
||||
public class DevSupportManagerImpl implements DevSupportManager {
|
||||
|
||||
private static final int JAVA_ERROR_COOKIE = -1;
|
||||
private static final int JSEXCEPTION_ERROR_COOKIE = -1;
|
||||
private static final String JS_BUNDLE_FILE_NAME = "ReactNativeDevBundle.js";
|
||||
private static enum ErrorType {
|
||||
JS,
|
||||
@@ -195,13 +194,7 @@ public class DevSupportManagerImpl implements DevSupportManager {
|
||||
public void handleException(Exception e) {
|
||||
if (mIsDevSupportEnabled) {
|
||||
FLog.e(ReactConstants.TAG, "Exception in native call from JS", e);
|
||||
if (e instanceof JSException) {
|
||||
// TODO #11638796: convert the stack into something useful
|
||||
showNewError(e.getMessage() + "\n\n" + ((JSException) e).getStack(), new StackFrame[] {},
|
||||
JSEXCEPTION_ERROR_COOKIE, ErrorType.JS);
|
||||
} else {
|
||||
showNewJavaError(e.getMessage(), e);
|
||||
}
|
||||
showNewJavaError(e.getMessage(), e);
|
||||
} else {
|
||||
mDefaultNativeModuleCallExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
package com.facebook.react.devsupport;
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
/**
|
||||
* This represents an error evaluating JavaScript. It includes the usual
|
||||
* message, and the raw JS stack where the error occurred (which may be empty).
|
||||
*/
|
||||
|
||||
@DoNotStrip
|
||||
public class JSException extends Exception {
|
||||
private final String mStack;
|
||||
|
||||
@DoNotStrip
|
||||
public JSException(String message, String stack, Throwable cause) {
|
||||
super(message, cause);
|
||||
mStack = stack;
|
||||
}
|
||||
|
||||
public JSException(String message, String stack) {
|
||||
super(message);
|
||||
mStack = stack;
|
||||
}
|
||||
|
||||
public String getStack() {
|
||||
return mStack;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user