web: make most client/network errors ignored by sentry

This commit is contained in:
Jens Langhammer
2020-12-12 23:32:55 +01:00
parent d2862ddc93
commit 434922f702
6 changed files with 31 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import { LitElement, html, customElement, property, TemplateResult } from "lit-element";
import { SentryIgnoredError } from "../../common/errors";
enum ResponseType {
redirect = "redirect",
@ -30,7 +31,7 @@ export class FlowShellCard extends LitElement {
// Fallback when the flow does not exist, just redirect to the root
window.location.pathname = "/";
} else if (!r.ok) {
throw Error(r.statusText);
throw new SentryIgnoredError(r.statusText);
}
return r;
})

View File

@ -8,6 +8,7 @@ import BackdropStyle from "@patternfly/patternfly/components/Backdrop/backdrop.c
import { SpinnerSize } from "../../elements/Spinner";
import { showMessage } from "../../elements/messages/MessageContainer";
import { gettext } from "django";
import { SentryIgnoredError } from "../../common/errors";
@customElement("ak-site-shell")
export class SiteShell extends LitElement {
@ -70,7 +71,7 @@ export class SiteShell extends LitElement {
level_tag: "error",
message: gettext(`Request failed: ${r.statusText}`),
});
throw new Error("Request failed");
throw new SentryIgnoredError("Request failed");
})
.then((r) => r.text())
.then((t) => {