[react_native] JS files from D1961099: Format stack trace on native side
This commit is contained in:
parent
4d44d9cca2
commit
128be89491
|
@ -36,12 +36,12 @@ function handleException(e: Exception) {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (RCTExceptionsManager) {
|
if (RCTExceptionsManager) {
|
||||||
RCTExceptionsManager.reportUnhandledException(e.message, format(stack));
|
RCTExceptionsManager.reportUnhandledException(e.message, stack);
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
(sourceMapPromise = sourceMapPromise || loadSourceMap())
|
(sourceMapPromise = sourceMapPromise || loadSourceMap())
|
||||||
.then(map => {
|
.then(map => {
|
||||||
var prettyStack = parseErrorStack(e, map);
|
var prettyStack = parseErrorStack(e, map);
|
||||||
RCTExceptionsManager.updateExceptionMessage(e.message, format(prettyStack));
|
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack);
|
||||||
})
|
})
|
||||||
.then(null, error => {
|
.then(null, error => {
|
||||||
console.error('#CLOWNTOWN (error while displaying error): ' + error.message);
|
console.error('#CLOWNTOWN (error while displaying error): ' + error.message);
|
||||||
|
@ -71,13 +71,4 @@ function fillSpaces(n) {
|
||||||
return new Array(n + 1).join(' ');
|
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 };
|
module.exports = { handleException };
|
||||||
|
|
Loading…
Reference in New Issue