@sentry/browser
@sentry/node
raven-js
raven-node
_(raven for node)_5.15.4
My application(Angular@9) throws rxjs.Observable.error()
and catch that by Sentry.captureException();
.
At Sentry.io, I saw
Hub.push../node_modules/@sentry/hub/esm/hub.js.Hub.withScope
error
Non-Error exception captured with keys: ...
https://sentry.io/organizations/{myorg}/issues/1582573825/
It may be better that Sentry.captureException() could be to catch rxjs.Observable.error()
simply.
Or had I mistaken for using @sentry/browser
??
import { Component } from "@angular/core";
import { Observable } from "rxjs";
@Component({
selector: "app-root",
template: `<button (click)="myProcess()"></button>`
})
export class AppComponent {
public myProcess(): void {
new Observable<{message: string}>(observer => {
observer.error({message: "my failure..."});
}).subscribe(result => console.log(result));
}
}
@Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() {}
handleError(error) {
Sentry.captureException(error.originalError || error);
}
}
I also hit this error but the OP wasn't super clear to me so I've created a repro: https://github.com/goosmurf/sentry-javascript-2533
You'll need to replace the DSN, then ng serve
and visit https://localhost:4200/
Note that the handleError() is basically a no-op but an exception is still logged.
If you set a breakpoint against Sentry.captureException() you can further observe that the exception is logged to sentry.io prior to handleError() being called.
Most helpful comment
I also hit this error but the OP wasn't super clear to me so I've created a repro: https://github.com/goosmurf/sentry-javascript-2533
You'll need to replace the DSN, then
ng serve
and visit https://localhost:4200/Note that the handleError() is basically a no-op but an exception is still logged.
If you set a breakpoint against Sentry.captureException() you can further observe that the exception is logged to sentry.io prior to handleError() being called.