Introduction
Lerix captures errors and crashes from your native iOS app so you can debug issues faster. After you complete the iOS installation, useLerix.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
UseLerix.throwError to manually report an error. This is useful when you catch an error 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, covering both:
- Uncaught exceptions (
NSException— e.g. an unimplemented selector, an invalid collection operation). - Fatal signals (
SIGABRT,SIGILL,SIGSEGV,SIGFPE,SIGBUS,SIGTRAP) — this is what catches typical Swift runtime traps: force-unwrappingnil, an array index out of range, a failedprecondition, and similar.
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):
Stack traces are symbolicated using the app’s own debug symbols at the time of the crash, so a Release build with symbols stripped may show addresses instead of function names for some frames — this is a normal characteristic of native crash reporting, not a bug in the SDK.
Verify the integration
Throw a test error to confirm everything is working:Filtering errors
Requires the iOS/macOS SDK 1.2.0 or later. Drop or rewrite error reports on the device before they are sent. Filtering runs on every report: manualthrowError calls, and crash
reports saved by the crash handler and sent on the next launch.
ignoreErrors([String]) andignoreErrorPatterns([NSRegularExpression]) run first. Blank strings are skipped.beforeSendthen gets aLerixErrorEventwithmessage,stack,type,severityandmetadata, all mutable. Return it (changed or not) to send it, ornilto drop it.- The message you match against is the issue title, which includes the error class.