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:
@@ -124,8 +124,14 @@ function eventsOnDay(dateStr) {
|
||||
// --------------------------------------------------------
|
||||
|
||||
async function loadRange(from, to) {
|
||||
const res = await api.get(`/calendar?from=${from}&to=${to}`);
|
||||
state.events = res.data;
|
||||
try {
|
||||
const res = await api.get(`/calendar?from=${from}&to=${to}`);
|
||||
state.events = res.data;
|
||||
} catch (err) {
|
||||
console.error('[Calendar] loadRange Fehler:', err);
|
||||
state.events = [];
|
||||
window.oikos?.showToast('Termine konnten nicht geladen werden.', 'danger');
|
||||
}
|
||||
state.rangeFrom = from;
|
||||
state.rangeTo = to;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user