fix too many errors in chrome (#1130)

This commit is contained in:
sua yoo 2023-09-05 18:36:40 -07:00 committed by GitHub
parent 93573d0bfe
commit 0cad649ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 13 deletions

View File

@ -308,7 +308,7 @@ export class Crawls extends LiteElement {
try {
this.crawls = await this.getCrawls(params);
} catch (e: any) {
if (e === ABORT_REASON_THROTTLE) {
if (e.name === "AbortError") {
console.debug("Fetch crawls aborted to throttle");
} else {
this.notify({

View File

@ -742,7 +742,7 @@ export class CollectionDetail extends LiteElement {
try {
this.archivedItems = await this.getArchivedItems(params);
} catch (e: any) {
if (e === ABORT_REASON_THROTTLE) {
if (e.name === "AbortError") {
console.debug("Fetch web captures aborted to throttle");
} else {
this.notify({

View File

@ -597,7 +597,7 @@ export class CrawlsList extends LiteElement {
try {
this.archivedItems = await this.getArchivedItems(params);
} catch (e: any) {
if (e === ABORT_REASON_THROTTLE) {
if (e.name === "AbortError") {
console.debug("Fetch archived items aborted to throttle");
} else {
this.notify({

View File

@ -160,18 +160,16 @@ export class WorkflowsList extends LiteElement {
const workflows = await this.getWorkflows(params);
this.workflows = workflows;
} catch (e: any) {
if (e === ABORT_REASON_THROTTLE) {
if (e.isApiError) {
this.fetchErrorStatusCode = e.statusCode;
} else if (e.name === "AbortError") {
console.debug("Fetch archived items aborted to throttle");
} else {
if (e.isApiError) {
this.fetchErrorStatusCode = e.statusCode;
} else {
this.notify({
message: msg("Sorry, couldn't retrieve Workflows at this time."),
variant: "danger",
icon: "exclamation-octagon",
});
}
this.notify({
message: msg("Sorry, couldn't retrieve Workflows at this time."),
variant: "danger",
icon: "exclamation-octagon",
});
}
}
this.isFetching = false;