From: Christian Kruse Date: 2002-04-04T20:40:01+09:00 Subject: Re: Test the result of an initialization ? Hoi, On Thu, 4 Apr 2002 20:31:32 +0900 jayce@mosx.net (Jayce Piel) wrote: > Is there a simple way to know if there were an error in the initialize > method ? > > Example : > I have a class "ArchiveFile". > Its initialize method have a 'path' parameter. > > What I want is if the path is not a path to a file, the object is not > created. I try to do a "return nil" in initialize, but it has no > effect. I think, you want to cast an exception and catch it in the initialization. > Do I need to test the file outside of the initialization ? No, of course not. Greets, CK