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.