Skip to content

Commit

Permalink
chore: suppress abort errors (#7120)
Browse files Browse the repository at this point in the history
* chore: suppress abort errors

* chore: return if aborted

* chore: linting
  • Loading branch information
jrasm91 committed Feb 14, 2024
1 parent 747df0a commit b823dff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions web/src/lib/stores/assets.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ export class AssetStore {
}
}

if (bucket.cancelToken.signal.aborted) {
return;
}

bucket.assets = assets;

this.emit(true);
Expand Down
5 changes: 2 additions & 3 deletions web/src/lib/utils/handle-error.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios';
import { notificationController, NotificationType } from '../components/shared-components/notification/notification';
import type { HttpError } from '@sveltejs/kit';
import { notificationController, NotificationType } from '../components/shared-components/notification/notification';

export async function getServerErrorMessage(error: unknown) {
let data = (error as HttpError)?.body;
Expand All @@ -17,7 +16,7 @@ export async function getServerErrorMessage(error: unknown) {
}

export async function handleError(error: unknown, message: string) {
if (axios.isCancel(error)) {
if ((error as Error)?.name === 'AbortError') {
return;
}

Expand Down

0 comments on commit b823dff

Please sign in to comment.