Skip to content

Commit ab45138

Browse files
luluwu2032facebook-github-bot
authored andcommitted
Report js exceptions via Lacrima
Summary: Why Lacrima? - Throw a JavascriptException in native won't get the js error reported to backend, we need to use reporter APIs - Lacrima is a new error reporting framework to report crashes and app deaths in android applications at Facebook, and it has APIs for reporting js exceptions. - ```FbErrorReporterImpl.java``` uses ```Acra``` API to report, and ```Lacrima``` is a rewrite of ```Acra``` https://fb.workplace.com/groups/323014308578038/ - We've been receiving js errors reported via Lacrima https://fburl.com/logview/y1vhc8u8 In this diff all js errors are treated as soft errors during reporting because they don't usually crash the app, crashes will be reported with a different category. Changelog: [Android][Chagned] - Change static string to public Reviewed By: fkgozali Differential Revision: D34095100 fbshipit-source-id: 73d89647134a197baf5d228d620732781b6bd723
1 parent 2b0d72a commit ab45138

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ReactAndroid/src/main/java/com/facebook/react/util/JSStackTrace.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
public class JSStackTrace {
1717

18-
private static final String LINE_NUMBER_KEY = "lineNumber";
18+
public static final String LINE_NUMBER_KEY = "lineNumber";
19+
public static final String FILE_KEY = "file";
20+
public static final String COLUMN_KEY = "column";
21+
public static final String METHOD_NAME_KEY = "methodName";
22+
1923
private static final Pattern FILE_ID_PATTERN =
2024
Pattern.compile("\\b((?:seg-\\d+(?:_\\d+)?|\\d+)\\.js)");
21-
private static final String FILE_KEY = "file";
22-
private static final String COLUMN_KEY = "column";
23-
private static final String METHOD_NAME_KEY = "methodName";
2425

2526
public static String format(String message, ReadableArray stack) {
2627
StringBuilder stringBuilder = new StringBuilder(message).append(", stack:\n");

0 commit comments

Comments
 (0)