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:
@@ -351,8 +351,14 @@ function updateListCounter(listId, totalDelta, checkedDelta) {
|
||||
// --------------------------------------------------------
|
||||
|
||||
async function loadLists() {
|
||||
const data = await api.get('/shopping');
|
||||
state.lists = data.data ?? [];
|
||||
try {
|
||||
const data = await api.get('/shopping');
|
||||
state.lists = data.data ?? [];
|
||||
} catch (err) {
|
||||
console.error('[Shopping] loadLists Fehler:', err);
|
||||
state.lists = [];
|
||||
window.oikos?.showToast('Listen konnten nicht geladen werden.', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
async function loadItems(listId) {
|
||||
@@ -366,9 +372,11 @@ async function switchList(listId, container) {
|
||||
renderTabs(container);
|
||||
try {
|
||||
await loadItems(listId);
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.error('[Shopping] loadItems Fehler:', err);
|
||||
state.items = [];
|
||||
state.activeList = state.lists.find((l) => l.id === listId) ?? null;
|
||||
window.oikos?.showToast('Artikel konnten nicht geladen werden.', 'danger');
|
||||
}
|
||||
renderListContent(container);
|
||||
wireListContentEvents(container);
|
||||
|
||||
Reference in New Issue
Block a user