On Mon, Oct 28, 2013 at 02:37:16AM -0700, Or Cohen wrote:
>
> Thank you for the quick response. You are right, the documentation states
> that this should be a string, and it does work when passing a string.
>
> I'd still like to note that this is an inconsistent behavior in Ruby, and
> the fact that IRB crashes is even more weird (a REPL should never crash):
>
> > StandardError.new("foo") # => <StandardError: foo>
> > StandardError.new(String) # => <StandardError: String>
> > NameError.new("foo") # => <NameError: foo>
> > NameError.new(String) # => Exception: `to_s': can't convert Class into
> String (TypeError)
>
> I've sent a patch (
>
http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/43447)
> and it was accepted so I guess that solves it.
Hello Or,
thanks for making Ruby better.
> Since this is a language (probably even implementation specific) bug,
> there's no point in fixing anything in ruote. I'm still wondering where the
> exception went, though.
I've added ```Thread.abort_on_exception = true``` on top of your sample code
and saw this:
```
7 13:14.466 80 di * 20131028-2113-jogegita-namesoso 2384e 0_1 part_a wi:
[0_1!2384e...!, 1], part: [PartA, {}]
/home/jmettraux/w/ruote/lib/ruote/exp/ro_on_x.rb:43:in `to_s': can't convert
Class into String (TypeError)
from /home/jmettraux/w/ruote/lib/ruote/exp/ro_on_x.rb:43:in `message'
from /home/jmettraux/w/ruote/lib/ruote/exp/ro_on_x.rb:43:in `deflate'
from /home/jmettraux/w/ruote/lib/ruote/svc/error_handler.rb:167:in `deflate'
from /home/jmettraux/w/ruote/lib/ruote/svc/error_handler.rb:152:in `rescue in handle'
from /home/jmettraux/w/ruote/lib/ruote/svc/error_handler.rb:110:in `handle'
from /home/jmettraux/w/ruote/lib/ruote/svc/error_handler.rb:65:in `msg_handle'
from /home/jmettraux/w/ruote/lib/ruote/svc/dispatch_pool.rb:98:in `rescue in do_dispatch'
from /home/jmettraux/w/ruote/lib/ruote/svc/dispatch_pool.rb:95:in `do_dispatch'
from /home/jmettraux/w/ruote/lib/ruote/svc/dispatch_pool.rb:115:in `block in do_threaded_dispatch'
```
The "can't convert Class into String" happens in the rescue handler, and
since it happens in the dispatch thread it is silently happening (and the
flow stalls).
I need to make sure the exception gets reported:
https://github.com/jmettraux/ruote/issues/90
Thanks a lot!
--
John Mettraux -
http://lambda.io/jmettraux