Introduction
Lerix captures errors from your Angular app so you can debug issues faster. After you complete the Angular installation, useLerixService.throwError() to send custom errors to your dashboard —
uncaught errors are captured automatically, with no extra code required.
Make sure you have registered the SDK with
provideLerix() before reporting errors.Report an error
Parameters
BugType values
BugSeverity values
Automatic error capture
provideLerix() installs error capture two ways, so nothing needs wrapping in a try/catch for baseline coverage:
- A custom Angular
ErrorHandlercatches anything thrown inside Angular’s zone — template bindings, component lifecycle hooks, RxJS subscriptions. - Global
window.onerrorandunhandledrejectionlisteners catch everything else.
throwError calls):
Automatic stack capture
When you callthrowError() without a stack argument, one is captured
automatically from the call site — you only need to pass one explicitly
when reporting a caught Error’s own stack instead (e.g.
error.stack?.split('\n')).
Either way, every stack frame is resolved from its compiled/bundled
position (e.g. main.js:577:15) back to the original source file and line,
using the build’s own source map — the same mechanism browser DevTools use
to show you readable stack traces instead of minified bundle positions.
This happens automatically; there’s nothing to configure.
Resolution requires a source map to be reachable at the frame’s URL —
always true in development, and true in production only if your build
serves its
.map files publicly. If your production build keeps source
maps private (a common choice), frames fall back to their compiled
position rather than failing to report — resolution is best-effort and
never blocks or delays the report itself.Verify the integration
Filtering errors
Requires@lerix-dev/lerix-angular 1.2.0 or later.
Two optional provideLerix() options decide which errors are sent. They
apply to every report: the Angular ErrorHandler, the global handlers and
LerixService.throwError.
app.config.ts
ignoreErrorsruns first. A string drops any error whose message contains it, ignoring case. ARegExpdrops any error whose message it matches. Empty strings are skipped.beforeSendthen sees only what’s left. Return the event (changed or not) to send it, ornullto drop it. If it throws, the original event is sent and the exception never reaches your app.- The message you match against is the issue title, which includes the error
class, for example
TypeError: boom.
beforeSend receives a LerixErrorEvent:
{ message, stack, type, severity, metadata? }. stack is an array of
frames, already resolved through your source maps.
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.