Flurl: More robust FlurlHttpException.Message

Include URL, verb, status code, and request/response bodies (if present). Example:

POST https://myapi.com/foo failed with status code 400 (Bad Request).
Request body:
{"data":"bad"}
Response body:
{"message":"bad data!"}

Note that all values are plucked out of FlurlHttpException.Call object, so rolling your own error message from a catch block is easy, i.e. no need to parse the text above.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’m not a fan of this “enhancement.” I make quite a few requests with rather large bodies and now I’m logging unreadable exception messages with 12,000 characters! This seems to go against the general framework designs where Exception subtypes are enriched with additional properties rather than dumping everything in the message. The old behavior was preferable.

I just got bit by this…

Suddenly I am getting sensitive data written to the logs when it shouldn’t be… Wish there was a better way to disable this feature…