lostisland / faraday

Simple, but flexible HTTP client library, with support for multiple backends.
https://lostisland.github.io/faraday
MIT License
5.74k stars 976 forks source link

Include `env[:headers]` in `Stubs::NotFound` #1514

Closed yykamei closed 1 year ago

yykamei commented 1 year ago

When using strict_mode, I often get an error with Stubs::NotFound and can't figure out why such an error happens at a glance. After looking into the problem carefully, I finally find out some headers are missing. This is not a good developer experience.

I think the error message of Stubs::NotFound should include headers to let developers know the difference between the expected and actual requests.

That's why this patch appends env[:headers] to the error message.