← All platforms

Angular error tracking

Angular has an error handler. Give it somewhere to send the report. The Sentry Angular SDK works with Telebugs on your server.

~/hoofnotes  npm install @sentry/angular
~/hoofnotes  nvim src/main.ts
import { ErrorHandler } from "@angular/core";
import { bootstrapApplication } from "@angular/platform-browser";
import { AppComponent } from "./app/app.component";
import { appConfig } from "./app/app.config";
import * as Sentry from "@sentry/angular";
Sentry.init({
// Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
});
// Remove this test once it appears in Telebugs.
Sentry.captureException(new Error("Hello from Hoof Notes"));
bootstrapApplication(AppComponent, {
...appConfig,
providers: [
...appConfig.providers,
{ provide: ErrorHandler, useValue: Sentry.createErrorHandler() },
],
}).catch((error) => Sentry.captureException(error));
~/hoofnotes  npm start -- --open

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep @sentry/angular. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

Will errors caught by Angular reach Telebugs?

Yes. The SDK’s Angular error handler reports them, including errors a browser listener alone wouldn’t see. It works with standalone and module-based apps.

Can I read the original TypeScript?

Yes. Give Telebugs the matching source maps and it can show your original TypeScript, with filenames and line numbers, instead of a minified backtrace.