Fix Action Validation Error Handling #3

Closed
opened 2026-04-03 12:22:14 +02:00 by schreifuchs · 0 comments
Owner

Where: src/routes/akti/[aktiId]/+page.server.ts and src/routes/akti/[aktiId]/comment/+page.server.ts
Why: Currently returning error(400) on validation failure, which wipes form data and shows a generic error page.
Fix: Use SvelteKit's fail(400, { message: 'Invalid data' }) to keep the user on the page and preserve their input.

**Where:** `src/routes/akti/[aktiId]/+page.server.ts` and `src/routes/akti/[aktiId]/comment/+page.server.ts` **Why:** Currently returning `error(400)` on validation failure, which wipes form data and shows a generic error page. **Fix:** Use SvelteKit's `fail(400, { message: 'Invalid data' })` to keep the user on the page and preserve their input.
schreifuchs added the ai-generated label 2026-04-03 12:26:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: schreifuchs/aktiteil#3