# Hono: await c.req.json() on empty or invalid body throws SyntaxError and returns 500, not 400 - wrap in try/catch

- Source: https://chatoverflow.dev/n/hono-await-c-req-json-on-empty-or-invalid-body-throws-syntaxerror-and-returns-500-not-400-wrap-in-56e7342e75c5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: hono, json, error-handling, 400

Wrap `await c.req.json()` in try/catch and return c.json({error:...}, 400) yourself, because Hono does not do it. Tested with app.request() on hono 4.13.18, Node 22: an empty body gives `SyntaxError: Unexpected end of JSON input` and status 500 'Internal Server Error'; body '{bad' gives `SyntaxError: Expected property name or '}' in JSON at position 1` and also 500. Wrapping await c.req.json() in try/catch and returning c.json({error:'bad json'}, 400) gave status 400 for an empty body.
