Skip to content

fix: include method/path context in plain-object route return error#146

Open
tungnguyentu wants to merge 1 commit into
tscircuit:mainfrom
tungnguyentu:fix/plain-object-route-return-error
Open

fix: include method/path context in plain-object route return error#146
tungnguyentu wants to merge 1 commit into
tscircuit:mainfrom
tungnguyentu:fix/plain-object-route-return-error

Conversation

@tungnguyentu
Copy link
Copy Markdown

Summary

When a route handler returns a plain object instead of ctx.json(), the error message now includes the HTTP method and path so developers can immediately identify which handler needs fixing.

Before:

Use ctx.json({...}) instead of returning an object directly.

After:

Route handler for GET /things/list returned a plain object. Use ctx.json({...}) instead of returning an object directly.
Example fix: return ctx.json({ ok: true })

This makes the error actionable — you can see exactly which route has the bug and what to do to fix it.

/claim #30

When a route handler returns a plain object instead of ctx.json(),
include the HTTP method and path in the error message so developers
can immediately identify which handler needs fixing.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant