aberant / osc-ruby

Open Sound Control Library for Ruby
MIT License
94 stars 16 forks source link

Silently rescuing exception #13

Closed btendrich closed 4 years ago

btendrich commented 5 years ago

It seems like osc-ruby is silently rescuing exception inside the message handlers.

If I raise an arbitrary exception inside a block passed to add_method the exception is silently handled somewhere. My most base example was to take the example code and add raise my own exception:


require 'rubygems'
require 'osc-ruby'
require 'osc-ruby/em_server'

@server = OSC::EMServer.new( 3333 )
@client = OSC::Client.new( 'localhost', 3333 )

@server.add_method '/greeting' do | message |
  puts "#{message.ip_address}:#{message.ip_port} -- #{message.address} -- #{message.to_a}"
  raise Exception.new "This is an exception"
end

Thread.new do
  @server.run
end

@client.send( OSC::Message.new( "/greeting" , "hullo!" ))

sleep( 3 )``` 

And I get nothing.
aberant commented 5 years ago

Since there's no rescue blocks in the em_server file, I'm wondering if there's something in event machine or how I'm using event machine that's responsible for this.

I'll check into that in my next free block of time.

aberant commented 5 years ago

I can confirm I'm seeing this. There's something in eventmachine channel that's swallowing the exceptions. I'll update when I figure something out.

aberant commented 5 years ago

Yeah, eventmachine is swallowing the exceptions. There is some way to get the error messages out. I'll first work on exposing those error messages, and then maybe see if i can reconstitute them back into "real" exceptions.

aberant commented 4 years ago

I've fixed this in the 1.1.4 version of the gem