Skip to content

Fixes #30 /claim #30 - #164

Open
theherrovn-sys wants to merge 1 commit into
tscircuit:mainfrom
theherrovn-sys:main
Open

Fixes #30 /claim #30#164
theherrovn-sys wants to merge 1 commit into
tscircuit:mainfrom
theherrovn-sys:main

Conversation

@theherrovn-sys

Copy link
Copy Markdown

Fixes #30 /claim #30

  • Changed withResponseObjectCheck middleware to throw RawJsonResponseError (extends BadRequestError, an HttpException) instead of plain Error
  • This ensures the error message "Use ctx.json({...}) instead of returning an object directly" properly propagates through the middleware chain
  • Updated withUnhandledExceptionHandling to return proper JSON error responses for HttpException instances instead of blank 500 responses
  • All 185 tests pass, including do-not-allow-raw-json and invalid-response-error tests

@MikeGarciaAGM MikeGarciaAGM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The response-object check and exception handling changes are tightly scoped, and the new coverage matches the intended contract cleanly.

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.

When a user returns return { ... } from a route instead of return ctx.json({ ... }), throw an error telling them to use ctx.json

2 participants