Skip to content

POST /api/demo has zero error handling #9

Description

@royalpinto007

Problem

POST /api/demo dereferences a possibly-null insert ((run as {id}).id) with no error check, unlike /api/runs which returns structured 500s. Any DB failure becomes an unhandled TypeError.

Where

app/api/demo/route.ts (insert + id reads).

Acceptance

Add a failing test first with Supabase unavailable asserting /api/demo returns JSON {error: ...} with a 5xx status. Then fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions