rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.69k stars 120 forks source link

Exceptions within `.on()` blocks are mysteriously ignored #396

Closed postmodern closed 6 months ago

postmodern commented 10 months ago

I noticed that exceptions raised within .on() blocks are mysterious ignored, and not even logged. This makes debugging errors within other code that's called within .on() blocks very difficult.

Example Code

require 'ferrum'

browser = Ferrum::Browser.new
browser.network.intercept
browser.on(:request) do
  raise("error!")
end

browser.go_to('https://example.com')
sleep

Expected Result

An uncaught exception being raised.

Actual Result

Nothing

Version Information

route commented 10 months ago

I believe it's https://github.com/ruby-concurrency/concurrent-ruby/issues/634 but I never had time to work on it.