Skip to main content

Introduction

Lerix captures errors and crashes from your native Android app so you can debug issues faster. After you complete the Android installation, use Lerix.throwError to send custom errors or caught exceptions to your dashboard — uncaught crashes are captured automatically, with no extra code required.
Make sure you have initialized the SDK with Lerix.initialize() before reporting errors.

Report an error

Use Lerix.throwError to manually report an error. This is useful when you catch an exception yourself and want to send it to Lerix with extra context.

Parameters

BugType values

BugSeverity values

Automatic crash capture

Lerix.initialize() installs a crash handler by default, wrapping Java/Kotlin’s global Thread.setDefaultUncaughtExceptionHandler — any uncaught exception on any thread is captured, regardless of which thread it occurs on. A crash can’t reliably make a network call — the process is already terminating — so the report is written to disk synchronously at crash time, then sent automatically the next time your app launches, tagged type: CRASH, severity: CRITICAL. You don’t need to do anything to receive it; it shows up in the dashboard on the following launch. To disable it (e.g. if your app already has its own crash reporter and you only want manual throwError calls):

Verify the integration

Throw a test error to confirm everything is working:
Then open your dashboard — the error should appear within seconds.

Filtering errors

Requires the Android SDK 1.2.0 or later. Drop noisy errors or scrub data before it leaves the device. Filtering applies to every error the SDK sends: Lerix.throwError and uncaught crashes (checked when the crash is sent on the next launch).
  • ignoreErrors (List<String>) and ignoreErrorPatterns (List<Regex>) run first. Empty or whitespace-only ignoreErrors entries are skipped.
  • beforeSend then gets a LerixErrorEvent with message, stack, type, severity and metadata. Return it (changed or not) to send it, or null to drop it. It is called on a background thread.
  • If beforeSend throws, the original event is sent and the exception is swallowed (logged in debugMode).
  • The message you match against is the issue title, which includes the error class.
Lerix also groups repeated errors into one issue and filters common noise on the server, for every SDK version. See How errors are grouped into issues.