From c9e61444519a9c57c71e35d0b932f0a0e8f24b21 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Wed, 29 May 2024 14:15:59 +0200 Subject: [PATCH] Rethrow errors instead of just log them in historyStore --- client/src/stores/historyStore.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/stores/historyStore.ts b/client/src/stores/historyStore.ts index e74d6a12497..1de4f7e5b44 100644 --- a/client/src/stores/historyStore.ts +++ b/client/src/stores/historyStore.ts @@ -24,6 +24,7 @@ import { setCurrentHistoryOnServer, updateHistoryFields, } from "@/stores/services/history.services"; +import { rethrowSimple } from "@/utils/simple-error"; import { sortByObjectProp } from "@/utils/sorting"; const PAGINATION_LIMIT = 10; @@ -209,7 +210,7 @@ export const useHistoryStore = defineStore("historyStore", () => { selectHistory(history); return history; } catch (error) { - console.error(error); + rethrowSimple(error); } } @@ -257,7 +258,7 @@ export const useHistoryStore = defineStore("historyStore", () => { await handleTotalCountChange(histories.length); } } catch (error) { - console.error(error); + rethrowSimple(error); } finally { setHistoriesLoading(false); } @@ -272,7 +273,7 @@ export const useHistoryStore = defineStore("historyStore", () => { setHistory(history); return history; } catch (error) { - console.error(error); + rethrowSimple(error); } finally { isLoadingHistory.delete(historyId); } @@ -321,7 +322,7 @@ export const useHistoryStore = defineStore("historyStore", () => { setHistory(contentStats); return contentStats; } catch (error) { - console.error(error); + rethrowSimple(error); } }