Handle string messages

avoids "undefined" errors
pull/7863/head
Oliver Günther 5 years ago
parent 0c4cff0bb0
commit c331f42ef6
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 8
      frontend/src/app/sentry/sentry-reporter.ts

@ -107,11 +107,15 @@ export class SentryReporter implements ErrorReporter {
});
}
public captureException(err:Error) {
if (!this.client) {
public captureException(err:Error|string) {
if (!this.client || !err) {
return this.handleOfflineMessage('captureException', Array.from(arguments));
}
if (typeof err === 'string') {
return this.captureMessage(err, 'error');
}
this.client.withScope((scope:Scope) => {
this.setupContext(scope);
this.client.captureException(err);

Loading…
Cancel
Save