Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Response.error() #3591

Closed
jasnell opened this issue Feb 22, 2025 · 0 comments · Fixed by #3592
Closed

Implement Response.error() #3591

jasnell opened this issue Feb 22, 2025 · 0 comments · Fixed by #3592

Comments

@jasnell
Copy link
Member

jasnell commented Feb 22, 2025

To this point we have not implemented Response.error() with the explanation:

  // TODO(conform): implementation is missing; two approaches where tested:
  //  - returning a HTTP 5xx response but that doesn't match the spec and we didn't
  //    find it useful.
  //  - throwing/propagating a DISCONNECTED kj::Exception to actually disconnect the
  //    client. However, we were concerned about possible side-effects and incorrect
  //    error reporting.

WinterTC will be recommending that conformant implementations support Response.error(). We should implement it.

When a request is answered with an error response, the return back to the client will be a 500 error and a runtime error will be reported on the server-side. Whenever an error response is used anywhere we accept a Response an error will be thrown.

Response.error() use is surprisingly common.

Necessary for:

  • WinterTC Conformance
  • Node.js Conformance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant