fix: Error Handling in Backend und Frontend verbessern (Phase 5, Schritt 31)
- Backend: JSON-Parse-Error + Payload-Too-Large Middleware in index.js - Backend: Dashboard äußerer try/catch für db.get()-Fehler - Backend: contacts/meta Route mit try/catch - Frontend: try/catch + Toast-Fallback in loadMonth (budget), loadRange (calendar), loadWeek (meals), loadLists/switchList (shopping), initiales Laden (notes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+10
-3
@@ -74,9 +74,16 @@ function formatDayDate(dateStr) {
|
||||
// --------------------------------------------------------
|
||||
|
||||
async function loadWeek(week) {
|
||||
const res = await api.get(`/meals?week=${week}`);
|
||||
state.meals = res.data;
|
||||
state.currentWeek = getMondayOf(week);
|
||||
try {
|
||||
const res = await api.get(`/meals?week=${week}`);
|
||||
state.meals = res.data;
|
||||
state.currentWeek = getMondayOf(week);
|
||||
} catch (err) {
|
||||
console.error('[Meals] loadWeek Fehler:', err);
|
||||
state.meals = [];
|
||||
state.currentWeek = getMondayOf(week);
|
||||
window.oikos?.showToast('Essensplan konnte nicht geladen werden.', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
async function loadLists() {
|
||||
|
||||
Reference in New Issue
Block a user