Skip to content

Commit

Permalink
fix: Changed spelling of all catches to the same (where necessary)
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Groß <mail@gross-johannes.de>
  • Loading branch information
jo-gross committed Feb 13, 2024
1 parent 4faf346 commit b5e695b
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion components/ManageColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}}
/>,
Expand Down
2 changes: 1 addition & 1 deletion components/cocktails/CocktailRecipeCardItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions components/cocktails/CocktailRecipeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion components/garnishes/GarnishForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion components/glasses/GlassForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion components/layout/AuthBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
},
}}
Expand Down
2 changes: 1 addition & 1 deletion components/modals/CocktailDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions components/modals/SearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions components/modals/SelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function SelectModal<T>(props: SelectModalProps<T>) {
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);
Expand Down
4 changes: 2 additions & 2 deletions middleware/api/handleMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const withHttpMethods = (handlers: Partial<Record<HTTPMethod, (req: NextA

try {
return handler(req, res);
} catch (err) {
console.error(err);
} catch (error) {
console.error(error);
return res.status(HttpStatus.HTTP_STATUS_INTERNAL_SERVER_ERROR).json({ message: 'Internal error occurred!' });
}
};
Expand Down
10 changes: 5 additions & 5 deletions pages/workspaces/[workspaceId]/manage/calculations/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default function CalculationPage() {
alertService.error(body.message ?? 'Fehler beim Laden der Kalkulation', response.status, response.statusText);
}
})
.catch((err) => {
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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions pages/workspaces/[workspaceId]/manage/cards/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions pages/workspaces/[workspaceId]/manage/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions pages/workspaces/[workspaceId]/manage/statistics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 });
}
Expand Down

0 comments on commit b5e695b

Please sign in to comment.