Skip to content

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

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

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

Conversation

@sameelarif

Copy link
Copy Markdown
Owner

Problem

The /api/submit endpoint was throwing an intentional test exception that caused all POST requests to return 500 errors:

Error: Intentional API route error - this is a test exception

This was preventing the form submission functionality from working properly.

Solution

  • Removed the intentional throw new Error() statement from line 8 in src/app/api/submit/route.ts
  • The API now properly processes form submissions and returns appropriate HTTP status codes:
    • 200 for successful submissions with valid data
    • 400 for validation errors (missing name/email)
    • 500 only for actual server errors

Testing

  • Verified the API endpoint works correctly with valid form data
  • Confirmed validation still works for invalid requests
  • Tested both success and error scenarios

Additional Changes

  • Added server.log to .gitignore to prevent accidental commits of development server logs

The API is now fully functional and ready for production use.

@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 status codes
- Added server.log to .gitignore to prevent accidental commits

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:11pm

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