Skip to content

Fix API submit route by removing intentional test exception - #6

Open
sameelarif wants to merge 1 commit into
mainfrom
openhands-workspace-8bcg8wc9
Open

Fix API submit route by removing intentional test exception#6
sameelarif wants to merge 1 commit into
mainfrom
openhands-workspace-8bcg8wc9

Conversation

@sameelarif

Copy link
Copy Markdown
Owner

Problem

The /api/submit endpoint was throwing intentional test exceptions, causing all POST requests to return 500 errors with the message "Intentional API route error - this is a test exception".

Solution

  • Removed the intentional throw new Error("Intentional API route error - this is a test exception") statement from line 8 of src/app/api/submit/route.ts
  • The API now properly processes form submissions and returns appropriate responses:
    • 200 status with success data for valid requests
    • 400 status with validation errors for invalid requests
  • Updated .gitignore to exclude server.log and package-lock.json files

Testing

  • ✅ Tested with valid form data - returns 200 status with processed data
  • ✅ Tested with invalid form data (missing required fields) - returns 400 status with validation error
  • ✅ Verified proper logging functionality
  • ✅ Confirmed no more 500 errors from the intentional exception

Changes

  • src/app/api/submit/route.ts: Removed intentional test exception
  • .gitignore: Added server.log and package-lock.json entries

@sameelarif can click here to continue refining the PR

- Removed the intentional 'throw new Error()' statement that was causing 500 errors
- API now properly processes form submissions and returns appropriate responses
- Added server.log and package-lock.json to .gitignore

Co-authored-by: openhands <openhands@all-hands.dev>
@vercel

vercel Bot commented Oct 4, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dispatch Error Error Oct 4, 2025 8:12pm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants