Skip to content

Throw clear error when route handler returns plain object#47

Open
gavin-openops wants to merge 1 commit intotscircuit:mainfrom
gavin-openops:bounty-30-ctx-json-error
Open

Throw clear error when route handler returns plain object#47
gavin-openops wants to merge 1 commit intotscircuit:mainfrom
gavin-openops:bounty-30-ctx-json-error

Conversation

@gavin-openops
Copy link

/claim #30

Summary

  • improve the raw-object response error message to clearly instruct using ctx.json(...)
  • add a test that verifies the clear ctx.json(...) guidance is logged when a route returns a plain object
  • keep existing error-capture test and assert on the updated message

Testing

  • npx ava tests/errors/do-not-allow-raw-json.test.ts

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