[ReactNative] console.error shows RedBox with pretty stack trace

This commit is contained in:
Spencer Ahrens
2015-04-22 15:43:11 -07:00
parent c5ea25f7fb
commit e63bfae8f6
5 changed files with 39 additions and 29 deletions

View File

@@ -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();