mighty-gerbils / gerbil

Gerbil Scheme
https://cons.io
GNU Lesser General Public License v2.1
1.13k stars 111 forks source link

request-response-bytes should not throw away response body for non-200 status codes #1146

Closed JBetz closed 4 months ago

JBetz commented 4 months ago

https://github.com/mighty-gerbils/gerbil/blob/137ae6b58206a4b0f4bfe3083f081853beb09e84/src/std/net/request.ss#L526-L533

The error reports the status code and status text but throws away the response body, which can often contain useful debugging information.

vyzo commented 4 months ago

Sure, that makes sense, Care for a pr?

fare commented 4 months ago
  1. Simplest solution: add (ignore-errors (request-text req)) to the error irritants.
  2. Harder solution: make it a structured error, shove the req in it, and let the user retrieve the information they want.

I've implemented the first for now, but we should think hard and implement "Pitman errors" someday.

vyzo commented 4 months ago

Is there a pr?