diff --git a/src/server/request-handler.ts b/src/server/request-handler.ts index 19ae438..5eae7a7 100644 --- a/src/server/request-handler.ts +++ b/src/server/request-handler.ts @@ -857,7 +857,7 @@ function htmlPage(): string { for (const entry of listing) { if (controller.signal.aborted) { - throw new DOMException("Import abgebrochen", "AbortError"); + throw controller.signal.reason ?? new Error("Import abgebrochen"); } try { @@ -901,7 +901,7 @@ function htmlPage(): string { ); setProgress(listing.length, listing.length, "fertig"); } catch (error) { - if (error instanceof DOMException && error.name === "AbortError") { + if (controller.signal.aborted) { updateStatus("Import abgebrochen."); setProgress(state.processed, state.total, "abgebrochen"); return; @@ -940,7 +940,7 @@ function htmlPage(): string { cancelShare.addEventListener("click", () => { if (activeImportController) { - activeImportController.abort(); + activeImportController.abort("Import durch Benutzer abgebrochen"); } });