oesmith / puffing-billy

A rewriting web proxy for testing interactions between your browser and external sites. Works with ruby + rspec.
MIT License
656 stars 170 forks source link

Errors are suppressed in stub blocks #207

Closed printercu closed 6 years ago

printercu commented 6 years ago

Hi!

We use puffing-billy with webmock and I've faced that errors in blocks of subbed requests are suppressed. Like this:

stub_request(:get, 'some.domain').to_return { raise 'test' }

This errors gets logged and execution continues. I've found that it's due to https://github.com/oesmith/puffing-billy/blob/3905cd65727dc09a60c0f2c983e5f05b70497e8f/lib/billy/proxy.rb#L45

WDYT about remove suppressing and make it reraise error instead?

ronwsmith commented 6 years ago

@printercu I think there's a good contingent of users that wouldn't care about the errors, but feel free to add a new configurable option to remove the suppression.