help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Exception handling issue..


From: Rick Flower
Subject: Re: [Help-smalltalk] Exception handling issue..
Date: Thu, 01 Nov 2012 13:54:36 -0700
User-agent: Apple Webmail/0.6

On 01.11.2012 09:42, Rick Flower wrote:

Ok.. So I've got 3.2.4 install but I also saw this issue with 3.2 as
well..

I have defined an exception class as follows :

Error subclass: MissingRequiredXMLDescriptorFile [
MissingRequiredXMLDescriptorFile class >> signal: aMessage [
^self new signal: aMessage
]
]

I then have some code elsewhere that throws the exception :

areXMLDescriptionFilesPresent [
MissingRequiredXMLDescriptorFile signal: 'Foo!!!'
]

and try to catch it with the following :

[ sdf areXMLDescriptionFilesPresent ]
on: MissingRequiredXMLDescriptorFile
do: [:ex | Transcript show: ex messageText. ObjectMemory quit: 1].

Fixed my problem!! I changed the above code snippet to :

[ sdf areXMLDescriptionFilesPresent ]
on: Error
do: [:ex | Transcript show: ex messageText. ObjectMemory quit: 1].

Now it works as expected!!  I guess it wanted to see the more generic
base class Error as being caught instead of my nicely named derived
class..

Consider this issue closed and I'm good for now -- although I suspect
my Solaris build issues may need addressing at some point for those of
us using older build systems (gcc versions below 4.2).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]