Skip to content

Commit

Permalink
Add js engine information in React Native error reporting
Browse files Browse the repository at this point in the history
Summary:
To avoid "js engine: ..." appearing everywhere, only add this information
to the error message when react native is reporting errors to the server.

Reviewed By: yungsters

Differential Revision: D9754371

fbshipit-source-id: a8001480c75ccf93c953c79f26470df678871cb3
  • Loading branch information
xuyueee authored and facebook-github-bot committed Sep 12, 2018
1 parent 6e980a8 commit 2b1d8cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions Libraries/Core/Devtools/parseErrorStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type StackFrame = {

export type ExtendedError = Error & {
framesToPop?: number,
jsEngine?: string,
};

function parseErrorStack(e: ExtendedError): Array<StackFrame> {
Expand Down
10 changes: 4 additions & 6 deletions Libraries/Core/ExceptionsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@ function reportException(e: ExtendedError, isFatal: boolean) {
const parseErrorStack = require('parseErrorStack');
const stack = parseErrorStack(e);
const currentExceptionID = ++exceptionID;
const message =
e.jsEngine == null ? e.message : `${e.message}, js engine: ${e.jsEngine}`;
if (isFatal) {
ExceptionsManager.reportFatalException(
e.message,
message,
stack,
currentExceptionID,
);
} else {
ExceptionsManager.reportSoftException(
e.message,
stack,
currentExceptionID,
);
ExceptionsManager.reportSoftException(message, stack, currentExceptionID);
}
if (__DEV__) {
const symbolicateStackTrace = require('symbolicateStackTrace');
Expand Down

0 comments on commit 2b1d8cc

Please sign in to comment.