作者:亚S哥_271 | 来源:互联网 | 2023-06-06 15:15
I have a project where I followed the Sentry angular documentation at:https://docs.sentry.io/platfor
I have a project where I followed the Sentry angular documentation at:
https://docs.sentry.io/platforms/Javascript/angular/
And it worked fine and we were getting errors.
Seemed to work find for 7+ months. Soon as we started getting more users, we noticed that the number of errors in Sentry had increased a lot - a few 10s of thousands more than what we expected.
On debugging, I tried just disabling Sentry and was surprised to see quite a lot of errors still being reported!
I am using Angular 7 with
The error is from a network call that is giving me a unauthorized because some users try to access something they are not supposed to.
We catch these and show them a "Unauthorized" page appropriately. So, I don't want Sentry to report these!
The way we set it up is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| js
import * as Sentry from '/browser';
import { ErrorHandler, Injectable } from '/core';
()
export class SentryErrorHandler implements ErrorHandler {
constructor() {
Sentry.init({dsn: '.....'});
}
handleError(error: Error) {
if (error instanceof Error) {
console.error(error);
// Sentry.captureException(error); // |
I'm trying to figure out what is reporting these errors.
I see the stacktrace to be from Angular's zone modules. but I haven't configured it to report anything there to the best of my knowledge.