Skip to content

Commit

Permalink
Report js exceptions via Lacrima
Browse files Browse the repository at this point in the history
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
  • Loading branch information
luluwu2032 authored and facebook-github-bot committed Mar 4, 2022
1 parent 2b0d72a commit ab45138
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

public class JSStackTrace {

private static final String LINE_NUMBER_KEY = "lineNumber";
public static final String LINE_NUMBER_KEY = "lineNumber";
public static final String FILE_KEY = "file";
public static final String COLUMN_KEY = "column";
public static final String METHOD_NAME_KEY = "methodName";

private static final Pattern FILE_ID_PATTERN =
Pattern.compile("\\b((?:seg-\\d+(?:_\\d+)?|\\d+)\\.js)");
private static final String FILE_KEY = "file";
private static final String COLUMN_KEY = "column";
private static final String METHOD_NAME_KEY = "methodName";

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

0 comments on commit ab45138

Please sign in to comment.