[ReactNative] Back out D2014163 entirely

This commit is contained in:
Philipp von Weitershausen
2015-04-23 11:34:25 -07:00
parent 24095fcc2d
commit e88ba1a6a3
5 changed files with 29 additions and 43 deletions

View File

@@ -25,11 +25,17 @@ type Exception = {
message: string;
}
function reportException(e: Exception, stack?: any) {
function handleException(e: Exception) {
var stack = parseErrorStack(e);
console.error(
'Err0r: ' +
'\n stack: \n' + stackToString(stack) +
'\n URL: ' + e.sourceURL +
'\n line: ' + e.line +
'\n message: ' + e.message
);
if (RCTExceptionsManager) {
if (!stack) {
stack = parseErrorStack(e);
}
RCTExceptionsManager.reportUnhandledException(e.message, stack);
if (__DEV__) {
(sourceMapPromise = sourceMapPromise || loadSourceMap())
@@ -44,18 +50,6 @@ function reportException(e: Exception, stack?: any) {
}
}
function handleException(e: Exception) {
var stack = parseErrorStack(e);
console.log(
'Error: ' +
'\n stack: \n' + stackToString(stack) +
'\n URL: ' + e.sourceURL +
'\n line: ' + e.line +
'\n message: ' + e.message
);
reportException(e, stack);
}
function stackToString(stack) {
var maxLength = Math.max.apply(null, stack.map(frame => frame.methodName.length));
return stack.map(frame => stackFrameToString(frame, maxLength)).join('\n');
@@ -77,4 +71,4 @@ function fillSpaces(n) {
return new Array(n + 1).join(' ');
}
module.exports = { handleException, reportException };
module.exports = { handleException };