Skip to content

Fix API route exception: Remove intentional test error from /api/submit - #7

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

Fix API route exception: Remove intentional test error from /api/submit#7
sameelarif wants to merge 1 commit into
mainfrom
openhands-workspace-lkm0c791

Conversation

@sameelarif

Copy link
Copy Markdown
Owner

Summary

This PR fixes the 500 error occurring in the /api/submit endpoint by removing an intentional test exception that was causing all form submissions to fail.

Changes Made

  • Removed intentional exception: Deleted the throw new Error("Intentional API route error - this is a test exception"); statement from the POST handler
  • Updated .gitignore: Added server.log to prevent log files from being committed to version control

Testing

  • ✅ Verified successful form submission with valid data returns 200 status
  • ✅ Confirmed validation still works correctly (returns 400 for missing required fields)
  • ✅ API now processes form data and returns proper success responses

Before

POST /api/submit → 500 Internal Server Error
Error: Intentional API route error - this is a test exception

After

POST /api/submit → 200 OK
{
  "success": true,
  "message": "Form submitted successfully",
  "data": { ... }
}

The API route now functions as intended, properly handling form submissions and validation.

@sameelarif can click here to continue refining the PR

- Removed the intentional 'throw new Error()' statement that was causing 500 errors
- The API route now properly processes form submissions and returns success responses
- Added server.log to .gitignore to prevent log files from being committed

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

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