[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DRb and exceptions

Ferenc Engard

6/12/2005 8:30:00 PM

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:

c:/ruby/lib/ruby/1.8/drb/drb.rb:558:in `load': connection closed
(DRb::DRbConnError)
from c:/ruby/lib/ruby/1.8/drb/drb.rb:611:in `recv_reply'
from c:/ruby/lib/ruby/1.8/drb/drb.rb:865:in `recv_reply'
from c:/ruby/lib/ruby/1.8/drb/drb.rb:1104:in `send_message'
from c:/ruby/lib/ruby/1.8/drb/drb.rb:1015:in `method_missing'
from c:/ruby/lib/ruby/1.8/drb/drb.rb:1014:in `open'
from c:/ruby/lib/ruby/1.8/drb/drb.rb:1014:in `method_missing'
from chaos.rb:27:in `initialize'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here I called a remote method

What do I do wrong?

Thanks:
Ferenc



24 Answers

Eric Hodel

6/12/2005 10:40:00 PM

0

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://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04



Ferenc Engard

6/14/2005 10:49:00 PM

0

> > 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?
>
[...]
> raise RuntimeError, "Here we go!"
[...]

Thank you, I have recognised my problem: the exception I raised was not
a StandardError descendant.

Anyway, there are not too much documentation about standard exception
classes, and its handling, but I have realized that only StandardError
and its descendants I catched by a simple 'rescue'. So I have to make my
own exceptions a subclass of StandardError instead of Exception.

Thanks again!
Ferenc



Lady Azure, Baroness of the North Pole

8/21/2012 6:57:00 AM

0



Jazzy Belle wrote:

> On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
> > The time is nigh for your demons to face strong spiritual rebuke and the
> > fear that causes within them has made you both unwilling to open a public
> > chat room.
> >
> > Stand up and deny the demons, open a public chat room where your demons
> > can be confronted, rebuked, and spiritually bound from continuing to
> > destroy your souls.
> >
> > Fear not the power of the Lord, peace can again be yours.
>
> Vapid melodrama noted.

Vapid, or Vaporous!

Lady Azure, Baroness of the North Pole

8/21/2012 7:00:00 AM

0



marston shores wrote:

> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrnite@yahoo.com> wrote:
>
> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
> >> The time is nigh for your demons to face strong spiritual rebuke and the
> >> fear that causes within them has made you both unwilling to open a
> >> public
> >> chat room.
> >>
> >> Stand up and deny the demons, open a public chat room where your demons
> >> can be confronted, rebuked, and spiritually bound from continuing to
> >> destroy your souls.
> >>
> >> Fear not the power of the Lord, peace can again be yours.
> >
> > Vapid melodrama noted.
> >
> > Once again I should point out you are free to open a chat room
> > yourself and post the details on usenet.
> >
> > Moe
>
> You seem very interested in my doing so.
>
> Go to the Chatnet US server and try the channel #bob-larson.

As in Bob and Carol!

Kent Wills

8/21/2012 9:24:00 AM

0

On Mon, 20 Aug 2012 22:59:30 -0800, "Lady Azure, Baroness of the North
Pole" <laddie'o'lugh@gall's.org> wrote:

>marston shores wrote:
>
>> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrnite@yahoo.com> wrote:
>>
>> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
>> >> The time is nigh for your demons to face strong spiritual rebuke and the
>> >> fear that causes within them has made you both unwilling to open a
>> >> public
>> >> chat room.
>> >>
>> >> Stand up and deny the demons, open a public chat room where your demons
>> >> can be confronted, rebuked, and spiritually bound from continuing to
>> >> destroy your souls.
>> >>
>> >> Fear not the power of the Lord, peace can again be yours.
>> >
>> > Vapid melodrama noted.
>> >
>> > Once again I should point out you are free to open a chat room
>> > yourself and post the details on usenet.
>> >
>> > Moe
>>
>> You seem very interested in my doing so.
>>
>> Go to the Chatnet US server and try the channel #bob-larson.
>
>As in Bob and Carol!

Bob Lar$on is NOT the Bob of Bob and Carol fame.

--
"Hail imp," shouted Vlad, the Imp Hailer.

Lady Azure, Baroness of the North Pole

8/22/2012 8:11:00 AM

0



K Wills wrote:

> On Mon, 20 Aug 2012 22:59:30 -0800, "Lady Azure, Baroness of the North
> Pole" <laddie'o'lugh@gall's.org> wrote:
>
> >marston shores wrote:
> >
> >> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrnite@yahoo.com> wrote:
> >>
> >> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
> >> >> The time is nigh for your demons to face strong spiritual rebuke and the
> >> >> fear that causes within them has made you both unwilling to open a
> >> >> public
> >> >> chat room.
> >> >>
> >> >> Stand up and deny the demons, open a public chat room where your demons
> >> >> can be confronted, rebuked, and spiritually bound from continuing to
> >> >> destroy your souls.
> >> >>
> >> >> Fear not the power of the Lord, peace can again be yours.
> >> >
> >> > Vapid melodrama noted.
> >> >
> >> > Once again I should point out you are free to open a chat room
> >> > yourself and post the details on usenet.
> >> >
> >> > Moe
> >>
> >> You seem very interested in my doing so.
> >>
> >> Go to the Chatnet US server and try the channel #bob-larson.
> >
> >As in Bob and Carol!
>
> Bob Lar$on is NOT the Bob of Bob and Carol fame.

Kook, Basher is Kook, Basher!

Andrew Wilson

8/22/2012 10:31:00 AM

0

On Aug 22, 3:11 am, "Lady Azure, Baroness of the North Pole"
<laddie'o'lugh@gall's.org> wrote:
> K Wills wrote:
> > On Mon, 20 Aug 2012 22:59:30 -0800, "Lady Azure, Baroness of the North
> > Pole" <laddie'o'lugh@gall's.org> wrote:
>
> > >marston shores wrote:
>
> > >> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrn...@yahoo.com> wrote:
>
> > >> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
> > >> >> The time is nigh for your demons to face strong spiritual rebuke and the
> > >> >> fear that causes within them has made you both unwilling to open a
> > >> >> public
> > >> >> chat room.
>
> > >> >> Stand up and deny the demons, open a public chat room where your demons
> > >> >> can be confronted, rebuked, and spiritually bound from continuing to
> > >> >> destroy your souls.
>
> > >> >> Fear not the power of the Lord, peace can again be yours.
>
> > >> > Vapid melodrama noted.
>
> > >> >  Once again I should point out you are free to open a chat room
> > >> > yourself and post the details on usenet.
>
> > >> >  Moe
>
> > >> You seem very interested in my doing so.
>
> > >> Go to the Chatnet US server and try the channel #bob-larson.
>
> > >As in Bob and Carol!
>
> >      Bob Lar$on is NOT the Bob of Bob and Carol fame.
>
> Kook, Basher is Kook, Basher!

huh?

Andrew Wilson

8/22/2012 10:38:00 AM

0

On Aug 21, 4:23 am, K Wills <compu...@gmail.com> wrote:
> On Mon, 20 Aug 2012 22:59:30 -0800, "Lady Azure, Baroness of the North
>
>
>
>
>
>
>
>
>
> Pole" <laddie'o'lugh@gall's.org> wrote:
> >marston shores wrote:
>
> >> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrn...@yahoo.com> wrote:
>
> >> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
> >> >> The time is nigh for your demons to face strong spiritual rebuke and the
> >> >> fear that causes within them has made you both unwilling to open a
> >> >> public
> >> >> chat room.
>
> >> >> Stand up and deny the demons, open a public chat room where your demons
> >> >> can be confronted, rebuked, and spiritually bound from continuing to
> >> >> destroy your souls.
>
> >> >> Fear not the power of the Lord, peace can again be yours.
>
> >> > Vapid melodrama noted.
>
> >> >  Once again I should point out you are free to open a chat room
> >> > yourself and post the details on usenet.
>
> >> >  Moe
>
> >> You seem very interested in my doing so.
>
> >> Go to the Chatnet US server and try the channel #bob-larson.
>
> >As in Bob and Carol!
>
>      Bob Lar$on is NOT the Bob of Bob and Carol fame.
>
> --
> "Hail imp," shouted Vlad, the Imp Hailer.

Bullshit.

Kent Wills

8/22/2012 1:03:00 PM

0

On Wed, 22 Aug 2012 00:11:28 -0800, "Lady Azure, Baroness of the North
Pole" <laddie'o'lugh@gall's.org> wrote:

[...]

>> >> You seem very interested in my doing so.
>> >>
>> >> Go to the Chatnet US server and try the channel #bob-larson.
>> >
>> >As in Bob and Carol!
>>
>> Bob Lar$on is NOT the Bob of Bob and Carol fame.
>
>Kook, Basher is Kook, Basher!

Both Bobs share similarities, but they are not the same person.

--
"I could have been ambassador to Moscow by now. Maybe even Private
Secretary. Instead, I'm watching a dinosaur trash my office..."

Kent Wills

8/22/2012 1:03:00 PM

0

On Wed, 22 Aug 2012 03:37:55 -0700 (PDT), Andrew Wilson
<awils3848x8@gmail.com> wrote:

>On Aug 21, 4:23 am, K Wills <compu...@gmail.com> wrote:
>> On Mon, 20 Aug 2012 22:59:30 -0800, "Lady Azure, Baroness of the North
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Pole" <laddie'o'lugh@gall's.org> wrote:
>> >marston shores wrote:
>>
>> >> On Mon, 20 Aug 2012 13:40:07 -0600, Jazzy Belle <fvrn...@yahoo.com> wrote:
>>
>> >> > On Aug 20, 12:53 pm, "marston shores" <k...@fa.ith> wrote:
>> >> >> The time is nigh for your demons to face strong spiritual rebuke and the
>> >> >> fear that causes within them has made you both unwilling to open a
>> >> >> public
>> >> >> chat room.
>>
>> >> >> Stand up and deny the demons, open a public chat room where your demons
>> >> >> can be confronted, rebuked, and spiritually bound from continuing to
>> >> >> destroy your souls.
>>
>> >> >> Fear not the power of the Lord, peace can again be yours.
>>
>> >> > Vapid melodrama noted.
>>
>> >> >  Once again I should point out you are free to open a chat room
>> >> > yourself and post the details on usenet.
>>
>> >> >  Moe
>>
>> >> You seem very interested in my doing so.
>>
>> >> Go to the Chatnet US server and try the channel #bob-larson.
>>
>> >As in Bob and Carol!
>>
>>      Bob Lar$on is NOT the Bob of Bob and Carol fame.
>>
>> --
>> "Hail imp," shouted Vlad, the Imp Hailer.
>
>Bullshit.

As far as I am aware, no one named Vlad has ever shouted, "Hail
imp." However, it's intended to be an item of humor and not a
statement of fact.

--
"Hail imp," shouted Vlad, the Imp Hailer.