From: Eric Hodel Date: 2005-05-14T07:32:17+09:00 Subject: Re: Customing the Exception class On 13 May 2005, at 14:35, Ara.T.Howard@noaa.gov wrote: > On Sat, 14 May 2005, Daniel Berger wrote: > > >> Hi all, >> >> I have a program where I want to send all errors to a file. So, I >> did this: [snip] >> This works for most errors, but it doesn't seem to work when the >> error >> is a SystemCallError. >> >> For example, this writes to the log as expected: >> >> print "Some crazy division: " >> p 1/0 >> >> But this does not: >> >> File.open("non-existant file") >> >> The latter raises an Errno::ENOENT. >> >> Why, if SystemCallError is a subclass of Exception, does my >> approach not >> work? How do I make this work as expected? > > maybe new? [snip] > not sure why... SystemCallError does not use Exception's initialize: rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError); rb_define_method(rb_eSystemCallError, "initialize", syserr_initialize, -1); -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04