From b5e695b5994120ffb709a1065c823c7d762b2497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Gro=C3=9F?= Date: Tue, 13 Feb 2024 13:00:55 +0100 Subject: [PATCH] fix: Changed spelling of all catches to the same (where necessary) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Groß --- components/ManageColumn.tsx | 2 +- components/cocktails/CocktailRecipeCardItem.tsx | 2 +- components/cocktails/CocktailRecipeForm.tsx | 4 ++-- components/garnishes/GarnishForm.tsx | 2 +- components/glasses/GlassForm.tsx | 2 +- components/layout/AuthBoundary/index.tsx | 2 +- components/modals/CocktailDetailModal.tsx | 2 +- components/modals/SearchModal.tsx | 4 ++-- components/modals/SelectModal.tsx | 4 ++-- middleware/api/handleMethods.ts | 4 ++-- .../[workspaceId]/manage/calculations/[id].tsx | 10 +++++----- pages/workspaces/[workspaceId]/manage/cards/[id].tsx | 6 +++--- .../workspaces/[workspaceId]/manage/settings/index.tsx | 8 ++++---- .../[workspaceId]/manage/statistics/index.tsx | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/components/ManageColumn.tsx b/components/ManageColumn.tsx index e0d82999..f49c277d 100644 --- a/components/ManageColumn.tsx +++ b/components/ManageColumn.tsx @@ -54,7 +54,7 @@ export function ManageColumn(props: ManageColumnProps) { }) .catch((error) => { console.error(`ManageColumn[${props.entity}] -> delete`, error); - alertService.error('Fehler beim Löschen'); + alertService.error('Es ist ein Fehler aufgetreten'); }); }} />, diff --git a/components/cocktails/CocktailRecipeCardItem.tsx b/components/cocktails/CocktailRecipeCardItem.tsx index f5ab4ff1..25b6dec6 100644 --- a/components/cocktails/CocktailRecipeCardItem.tsx +++ b/components/cocktails/CocktailRecipeCardItem.tsx @@ -48,7 +48,7 @@ export default function CocktailRecipeCardItem(props: CocktailRecipeOverviewItem } } catch (error) { console.error('CocktailRecipeCardItem -> addCocktailToStatistic', error); - alertService.error('Fehler beim Hinzufügen des Cocktails zur Statistik'); + alertService.error('Es ist ein Fehler aufgetreten'); } finally { setSubmittingStatistic(false); } diff --git a/components/cocktails/CocktailRecipeForm.tsx b/components/cocktails/CocktailRecipeForm.tsx index 2f5791e4..bfa92bb8 100644 --- a/components/cocktails/CocktailRecipeForm.tsx +++ b/components/cocktails/CocktailRecipeForm.tsx @@ -127,7 +127,7 @@ export function CocktailRecipeForm(props: CocktailRecipeFormProps) { }) .catch((error) => { console.error('CocktailRecipeForm -> fetchGlasses', error); - alertService.error('Fehler beim Laden der Gläser'); + alertService.error('Fehler beim laden der Gläser'); }) .finally(() => { setGlassesLoading(false); @@ -176,7 +176,7 @@ export function CocktailRecipeForm(props: CocktailRecipeFormProps) { }) .catch((error) => { console.error('CocktailRecipeForm -> fetchActions', error); - alertService.error('Fehler beim Laden der Zubereitungsmöglichkeiten'); + alertService.error('Fehler beim laden der Zubereitungsmöglichkeiten'); }) .finally(() => { setActionsLoading(false); diff --git a/components/garnishes/GarnishForm.tsx b/components/garnishes/GarnishForm.tsx index 2313d310..02703904 100644 --- a/components/garnishes/GarnishForm.tsx +++ b/components/garnishes/GarnishForm.tsx @@ -89,7 +89,7 @@ export function GarnishForm(props: GarnishFormProps) { } } catch (error) { console.error('GarnishForm -> onSubmit', error); - alertService.error('Es ist ein Fehler aufgetreten.'); + alertService.error('Es ist ein Fehler aufgetreten'); } }} validate={(values) => { diff --git a/components/glasses/GlassForm.tsx b/components/glasses/GlassForm.tsx index 187e37cc..bb17320a 100644 --- a/components/glasses/GlassForm.tsx +++ b/components/glasses/GlassForm.tsx @@ -89,7 +89,7 @@ export function GlassForm(props: GlassFormProps) { } } catch (error) { console.error('GarnishForm -> onSubmit', error); - alertService.error('Es ist ein fehler aufgetreten'); + alertService.error('Es ist ein Fehler aufgetreten'); } }} validate={(values) => { diff --git a/components/layout/AuthBoundary/index.tsx b/components/layout/AuthBoundary/index.tsx index 7f3c5fb0..94513f67 100644 --- a/components/layout/AuthBoundary/index.tsx +++ b/components/layout/AuthBoundary/index.tsx @@ -138,7 +138,7 @@ export function AuthBoundary(props: AlertBoundaryProps) { }) .catch((error) => { console.error('AuthBoundary -> updateUserSetting', error); - alertService.error('Fehler beim Aktualisieren der Nutzer-Einstellungen'); + alertService.error('Es ist ein Fehler aufgetreten'); }); }, }} diff --git a/components/modals/CocktailDetailModal.tsx b/components/modals/CocktailDetailModal.tsx index 209168f5..fc62d385 100644 --- a/components/modals/CocktailDetailModal.tsx +++ b/components/modals/CocktailDetailModal.tsx @@ -48,7 +48,7 @@ export function CocktailDetailModal(props: CocktailDetailModalProps) { } } catch (error) { console.log('CocktailDetailModal -> addCocktailToStatistic', error); - alertService.error('Fehler beim Hinzufügen des Cocktails zur Statistik'); + alertService.error('Es ist ein Fehler aufgetreten'); } finally { setSubmittingStatistic(false); } diff --git a/components/modals/SearchModal.tsx b/components/modals/SearchModal.tsx index 618c2cae..9dada861 100644 --- a/components/modals/SearchModal.tsx +++ b/components/modals/SearchModal.tsx @@ -58,7 +58,7 @@ export function SearchModal(props: SearchModalProps) { .catch((error) => { if (error.name != 'AbortError') { console.error('SearchModal -> search', error); - alertService.error('Fehler beim Suchen der Cocktails'); + alertService.error('Es ist ein Fehler aufgetreten'); } }) .finally(() => { @@ -99,7 +99,7 @@ export function SearchModal(props: SearchModalProps) { } } catch (error) { console.error('SearchModal -> addCocktailToStatistic', error); - alertService.error('Fehler beim Hinzufügen des Cocktails zur Statistik'); + alertService.error('Es ist ein Fehler aufgetreten'); } finally { setSubmittingStatistic(false); } diff --git a/components/modals/SelectModal.tsx b/components/modals/SelectModal.tsx index a96bb118..27d86b15 100644 --- a/components/modals/SelectModal.tsx +++ b/components/modals/SelectModal.tsx @@ -25,8 +25,8 @@ export function SelectModal(props: SelectModalProps) { setLoading(true); const elements = await props.fetchElements(search); setElements(elements); - } catch (e) { - console.error('SelectModal -> fetchElements', e); + } catch (error) { + console.error('SelectModal -> fetchElements', error); alertService.error('Fehler beim Laden der Daten'); } finally { setLoading(false); diff --git a/middleware/api/handleMethods.ts b/middleware/api/handleMethods.ts index 89fd6e22..23fd5fcd 100644 --- a/middleware/api/handleMethods.ts +++ b/middleware/api/handleMethods.ts @@ -16,8 +16,8 @@ export const withHttpMethods = (handlers: Partial { - console.error('CocktailCalculation -> useEffect[init, id != create]', err); - alertService.error('Fehler beim Laden der Kalkulation'); + .catch((error) => { + console.error('CocktailCalculation -> useEffect[init, id != create]', error); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setLoading(false); @@ -199,7 +199,7 @@ export default function CalculationPage() { }) .catch((error) => { console.error('CalculationId -> saveCalculation[create]', error); - alertService.error('Fehler beim Erstellen der Kalkulation'); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setSaving(false); @@ -236,7 +236,7 @@ export default function CalculationPage() { }) .catch((error) => { console.error('CalculationId -> saveCalculation[update]', error); - alertService.error('Fehler beim Aktualisieren der Kalkulation'); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setSaving(false); diff --git a/pages/workspaces/[workspaceId]/manage/cards/[id].tsx b/pages/workspaces/[workspaceId]/manage/cards/[id].tsx index 81058511..02bea4f9 100644 --- a/pages/workspaces/[workspaceId]/manage/cards/[id].tsx +++ b/pages/workspaces/[workspaceId]/manage/cards/[id].tsx @@ -74,8 +74,8 @@ function EditCocktailCard() { alertService.error(body.message ?? 'Fehler beim Laden der Cocktails', response.status, response.statusText); } }) - .catch((err) => { - console.error('CardId -> fetchCocktails', err); + .catch((error) => { + console.error('CardId -> fetchCocktails', error); alertService.error('Fehler beim Laden der Cocktails'); }) .finally(() => { @@ -119,7 +119,7 @@ function EditCocktailCard() { }) .catch((error) => { console.error('CardId -> deleteCard', error); - alertService.error('Fehler beim Löschen der Karte'); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setDeleting(false); diff --git a/pages/workspaces/[workspaceId]/manage/settings/index.tsx b/pages/workspaces/[workspaceId]/manage/settings/index.tsx index f42c0bac..98f504ce 100644 --- a/pages/workspaces/[workspaceId]/manage/settings/index.tsx +++ b/pages/workspaces/[workspaceId]/manage/settings/index.tsx @@ -86,7 +86,7 @@ export default function WorkspaceSettingPage() { } } catch (error) { console.error('SettingsPage -> importBackup', error); - alertService.error(`Fehler beim importieren`); + alertService.error(`Fehler beim Importieren`); } finally { setImporting(false); } @@ -109,7 +109,7 @@ export default function WorkspaceSettingPage() { }) .catch((error) => { console.error('SettingsPage -> handleDeleteWorkspace', error); - alertService.error('Fehler beim Löschen der Workspace'); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setWorkspaceDeleting(false); @@ -135,7 +135,7 @@ export default function WorkspaceSettingPage() { }) .catch((error) => { console.error('SettingsPage -> handleRenameWorkspace', error); - alertService.error('Fehler beim Umbenennen der Workspace'); + alertService.error('Es ist ein Fehler aufgetreten'); }) .finally(() => { setWorkspaceRenaming(false); @@ -164,7 +164,7 @@ export default function WorkspaceSettingPage() { }) .catch((error) => { console.error('SettingsPage -> handleUpdateSignage', error); - alertService.error('Fehler beim Update, z.B. zu große Datei'); + alertService.error('Es ist ein Fehler Aufgetreten, z.B. zu große Datei'); }) .finally(() => { setUpdatingSignage(false); diff --git a/pages/workspaces/[workspaceId]/manage/statistics/index.tsx b/pages/workspaces/[workspaceId]/manage/statistics/index.tsx index a8800ba3..5e4b8137 100644 --- a/pages/workspaces/[workspaceId]/manage/statistics/index.tsx +++ b/pages/workspaces/[workspaceId]/manage/statistics/index.tsx @@ -47,7 +47,7 @@ export default function StatisticsPage() { } } catch (error) { console.error('StatisticsPage -> refreshStatistics', error); - alertService.error('Fehler beim aktualisieren der Statistik'); + alertService.error('Es ist ein Fehler aufgetreten'); } finally { setLoading(false); } @@ -321,7 +321,7 @@ export default function StatisticsPage() { } } catch (error) { console.error('StatisticsPage -> deleteStatisticItem', error); - alertService.error('Fehler beim Löschen des Statistik-Eintrags'); + alertService.error('Es ist ein Fehler aufgetreten'); } finally { setItemDeleting({ ...itemDeleting, [item.id]: false }); }