From: Eric Hodel Date: 2005-06-13T07:39:51+09:00 Subject: Re: DRb and exceptions On 12 Jun 2005, at 13:29, Ferenc Engard wrote: > Hi all, > > The drb documentation says that I can raise exceptions in a remote > object method and the exception is marshaled to the calling side. > > Unfortunately this do not work for me. If any exception is raised in a > remote object, I get the following exception in the calling process: [snip] > What do I do wrong? What's your code? This works: $ cat exc.rb require 'drb' PATH = 'druby://localhost:9000' class Raiser def do_raise raise RuntimeError, "Here we go!" end end case ARGV.shift when 'client' raiser = DRbObject.new nil, PATH raiser.do_raise when 'server' DRb.start_service PATH, Raiser.new trap 'INT' do exit end DRb.thread.join else STDERR.puts "#{$0} client|server" exit 1 end $ ruby exc.rb server & [1] 3710 $ ruby exc.rb client (druby://localhost:9000) exc.rb:7:in `do_raise': Here we go! (RuntimeError) from exc.rb:14 -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04