[react_native] JS files from D1961099: Format stack trace on native side

This commit is contained in:
Alex Kotliarskyi 2015-04-02 15:01:06 -07:00
parent 4d44d9cca2
commit 128be89491
1 changed files with 2 additions and 11 deletions

View File

@ -36,12 +36,12 @@ function handleException(e: Exception) {
);
if (RCTExceptionsManager) {
RCTExceptionsManager.reportUnhandledException(e.message, format(stack));
RCTExceptionsManager.reportUnhandledException(e.message, stack);
if (__DEV__) {
(sourceMapPromise = sourceMapPromise || loadSourceMap())
.then(map => {
var prettyStack = parseErrorStack(e, map);
RCTExceptionsManager.updateExceptionMessage(e.message, format(prettyStack));
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack);
})
.then(null, error => {
console.error('#CLOWNTOWN (error while displaying error): ' + error.message);
@ -71,13 +71,4 @@ function fillSpaces(n) {
return new Array(n + 1).join(' ');
}
// HACK(frantic) Android currently expects stack trace to be a string #5920439
function format(stack) {
if (Platform.OS === 'android') {
return stackToString(stack);
} else {
return stack;
}
}
module.exports = { handleException };