Permalink
Browse files

List nested exception in Redbox

Reviewed By: AaaChiuuu

Differential Revision: D4928968

fbshipit-source-id: 3af8f4ad0f76f035d2167fbf4b4381b6503f6bd2
  • Loading branch information...
javache authored and facebook-github-bot committed Apr 21, 2017
1 parent 9bbbfb4 commit b4932082c7a4db2ae701fe219a64256449c67078
@@ -235,16 +235,21 @@ public void onReceive(Context context, Intent intent) {
@Override
public void handleException(Exception e) {
if (mIsDevSupportEnabled) {
String message = e.getMessage();
Throwable cause = e.getCause();
while (cause != null) {
message += "\n\n" + cause.getMessage();
cause = cause.getCause();
}
if (e instanceof JSException) {
FLog.e(ReactConstants.TAG, "Exception in native call from JS", e);
message += "\n\n" + ((JSException) e).getStack();
// TODO #11638796: convert the stack into something useful
showNewError(
e.getMessage() + "\n\n" + ((JSException) e).getStack(),
new StackFrame[] {},
JSEXCEPTION_ERROR_COOKIE,
ErrorType.JS);
showNewError(message, new StackFrame[] {}, JSEXCEPTION_ERROR_COOKIE, ErrorType.JS);
} else {
showNewJavaError(e.getMessage(), e);
showNewJavaError(message, e);
}
} else {
mDefaultNativeModuleCallExceptionHandler.handleException(e);

0 comments on commit b493208

Please sign in to comment.