[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Exception handling issue..
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] Exception handling issue.. |
Date: |
Mon, 26 Nov 2012 12:56:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
Il 01/11/2012 21:54, Rick Flower ha scritto:
> 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..
It seems that the MissingRequiredXMLDescriptorFile exception is not
visible where you're trying to catch it.
Perhaps it's in a different namespace?
Paolo
> 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).