show script eval errors in redbox

Differential Revision: D2624801

fb-gh-sync-id: 48741a8caf029415753a4c616a07f18d3660e6fb
This commit is contained in:
Felix Oghină
2015-11-06 11:42:24 -08:00
committed by facebook-github-bot-4
parent e6372719ea
commit 9647c5a257
4 changed files with 42 additions and 1 deletions

View File

@@ -134,7 +134,11 @@ public class CatalystInstance {
incrementPendingJSCalls();
mJSBundleLoader.loadScript(mBridge);
try {
mJSBundleLoader.loadScript(mBridge);
} catch (JSExecutionException e) {
mNativeModuleCallExceptionHandler.handleException(e);
}
initLatch.countDown();
}

View File

@@ -0,0 +1,17 @@
// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.react.bridge;
import com.facebook.proguard.annotations.DoNotStrip;
/**
* Exception thrown when there is an error evaluating JS, e.g. a syntax error.
*/
@DoNotStrip
public class JSExecutionException extends RuntimeException {
@DoNotStrip
public JSExecutionException(String detailMessage) {
super(detailMessage);
}
}