From 7b4865431e5c8d5e4223d26d8fbbb5a3eeb446f1 Mon Sep 17 00:00:00 2001 From: Konrad Mohrfeldt <km@roko.li> Date: Wed, 31 Jul 2024 11:45:38 +0200 Subject: [PATCH] fix(Calendar): remove invalid error message for aborted requests We abort requests if the underlying request data has changed, so there is no need to handle the resulting AbortError instances as actual errors. refs #304 --- src/stores/program.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/program.ts b/src/stores/program.ts index 581755ef..11ed9cc0 100644 --- a/src/stores/program.ts +++ b/src/stores/program.ts @@ -38,7 +38,7 @@ export function useProgramSlots(options: UseProgramOptions) { })) async function updateProgram() { - if (controller) controller.abort('date changed') + if (controller) controller.abort() error.value = undefined controller = new AbortController() isLoading.value = true @@ -48,6 +48,7 @@ export function useProgramSlots(options: UseProgramOptions) { requestInit: { signal: controller.signal }, }) } catch (e) { + if (e instanceof DOMException && e.name === 'AbortError') return error.value = ensureError(e) } finally { isLoading.value = false -- GitLab