mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 22:48:25 +08:00
Show a redbox when scripts fail to load
Reviewed By: yungsters Differential Revision: D3670186 fbshipit-source-id: 1c61b69c74a8f7cc255aa6d7afcdb117205922eb
This commit is contained in:
committed by
Facebook Github Bot 3
parent
e22abd91bf
commit
bbd1e455f3
@@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.common.JavascriptException;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
@@ -212,6 +213,10 @@ public class JSDebuggerWebSocketClient implements WebSocketListener {
|
||||
} else if ("result".equals(field)) {
|
||||
parser.nextToken();
|
||||
result = parser.getText();
|
||||
} else if ("error".equals(field)) {
|
||||
parser.nextToken();
|
||||
String error = parser.getText();
|
||||
abort(error, new JavascriptException(error));
|
||||
}
|
||||
}
|
||||
if (replyID != null) {
|
||||
|
||||
Reference in New Issue
Block a user