Re: [Fxruby-users] catching exceptions in event handlers
Status: Inactive
Brought to you by:
lyle
|
From: Emmanuel T. <emm...@wa...> - 2003-07-23 13:37:52
|
> Emmanuel Touzery wrote:
>
> > i'm happy to read that FXApp#run is going to "forward me" the exception.
but
> > it doesn't seem to work here (see code snippet at the end of the mail).
>
> Ahem.
>
> Emmanuel, when you run this program, you are correct that it raises an
> exception. Did you notice which line of code the backtrace was pointing
> to? ;)
>
> The exception that is raised in your onCmdOpen() method is being caught
> by the 'rescue' block at application.run. The code in that 'rescue'
> block raises yet another exception, though (hint: what does 'self' refer
> to in the call to FXMessageBox.error?).
not here..
i think we're not using the same version of fxruby:
C:\programs\glossary\test>ruby test.rb
test.rb:38:in `onCmdOpen': undefined local variable or method `pouf' for
#<Gloss
aryMainWindow:0x52d3c78> (NameError)
from test.rb:61:in `run'
from test.rb:61
i tried putting nothing in the rescue, or just a puts (before posting).
are you using some kind of development version of FXRuby? i'm testing under
windows2000 with the latest version on sourceforge. i tried yesterday under
linux as well and IIRC it didn't work either (but it was late, etc, i could
have did sth wrong).
emmanuel
|