I found a way since "raise" expects a Exception class or Exception
instance, so I did:
class Cancelled < GenericError
attr_reader :cancel_request
def initialize(cancel_request)
@cancel_request = cancel_request
super
end
end
...
cancel_exception = Transaction::Cancelled.new(cancel_req)
other_thread.raise cancel_exception
...
rescue Transaction::Cancelled => e
cancel_request = e.cancel_request
···
2008/8/14, Iñaki Baz Castillo <ibc@aliax.net>:
Hi, is it possible to send an object when running "raise" so the
"rescue" gets it?
--
Iñaki Baz Castillo
<ibc@aliax.net>