mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-31 09:08:48 +08:00
[ReactNative] console.error shows RedBox with pretty stack trace
This commit is contained in:
@@ -77,6 +77,7 @@ function handleErrorWithRedBox(e) {
|
||||
function setupRedBoxErrorHandler() {
|
||||
var ErrorUtils = require('ErrorUtils');
|
||||
ErrorUtils.setGlobalHandler(handleErrorWithRedBox);
|
||||
GLOBAL.reportException = require('ExceptionsManager').reportException;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,8 +135,8 @@ function setupGeolocation() {
|
||||
}
|
||||
|
||||
setupDocumentShim();
|
||||
setupRedBoxErrorHandler();
|
||||
setupTimers();
|
||||
setupRedBoxErrorHandler(); // needs to happen after setupTimers
|
||||
setupAlert();
|
||||
setupPromise();
|
||||
setupXHR();
|
||||
|
||||
Reference in New Issue
Block a user