Introduction
Lerix captures errors and exceptions from your Flutter app so you can debug issues faster. After you complete the Flutter installation, useLerix.throwError to send custom errors or caught exceptions to your dashboard.
Make sure you have initialized the SDK with
Lerix.init() before reporting errors.Report an error
UseLerix.throwError to manually report an error. This is useful when you catch an exception in a try/catch block and want to send it to Lerix with extra context.
main.dart
Parameters
BugType values
BugSeverity values
Automatic error capture
OnceLerix.init() has run, uncaught Flutter framework errors (via FlutterError.onError) and uncaught Dart errors (via PlatformDispatcher.instance.onError) are captured and sent automatically — you don’t need to wrap your whole app in a try/catch to get baseline coverage. Lerix.throwError is for cases you catch yourself and want to add classification or metadata to.
Uncaught errors are reported as critical crashes on every platform, including Flutter Web.
Verify the integration
Throw a test error to confirm everything is working:main.dart
Filtering errors
Requireslerix_flutter 0.3.0 or later.
Two optional Lerix.init options decide which errors are sent. They apply
to every report: uncaught Flutter, Dart and zone errors, Lerix.throwError,
and web.
ignoreErrors(List<Pattern>) runs first. AStringdrops any error whose message contains it, ignoring case. Empty or whitespace-only strings are skipped. ARegExpdrops any error whose message it matches.beforeSendthen gets aLerixErrorEvent(message,stack,type,severity,metadata). Return it to send it, return a changed copy fromcopyWith, or returnnullto drop it. IfbeforeSendthrows, the original report is sent and the exception is never rethrown into your app.- A dropped report is not sent and doesn’t call
onError. - The message you match against is the issue title, which includes the error class.