Exception handling issue..

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception handling issue..

Rick Flower-2
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].

However, I get the following backtrace...

Object: nil error: did not understand #goodness:
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #goodness:
(SysExcept.st:1407)
optimized [] in BlockClosure class>>exceptionHandlerSearchBlock
(BlkClosure.st:16)
[] in
SoftwareDevelopmentFolder.MissingRequiredXMLDescriptorFile(Exception)>>instantiateNextHandlerFrom:
(ExcHandling.st:340)
MethodContext(ContextPart)>>scanBacktraceForAttribute:do:
(ContextPart.st:449)
SoftwareDevelopmentFolder.MissingRequiredXMLDescriptorFile(Exception)>>instantiateNextHandlerFrom:
(ExcHandling.st:342)
SoftwareDevelopmentFolder.MissingRequiredXMLDescriptorFile(Exception)>>signal
(ExcHandling.st:254)
SoftwareDevelopmentFolder.MissingRequiredXMLDescriptorFile(Exception)>>signal:
(ExcHandling.st:264)
SoftwareDevelopmentFolder.MissingRequiredXMLDescriptorFile
class>>signal:
(../../../../../home/rflower/gst/share/smalltalk/site-packages/SDFItemBase.st:9)
SoftwareDevelopmentFolder.SDF>>areXMLDescriptionFilesPresent
(../../../../../home/rflower/gst/share/smalltalk/site-packages/SDF.st:32)
optimized [] in UndefinedObject>>executeStatements
(../../../gst/share/smalltalk/site-packages/BuildSDF.st:59)
BlockClosure>>on:do: (BlkClosure.st:193)
optimized [] in UndefinedObject>>executeStatements
(../../../gst/share/smalltalk/site-packages/BuildSDF.st:64)
OrderedCollection>>do: (OrderColl.st:68)
UndefinedObject>>executeStatements
(../../../gst/share/smalltalk/site-packages/BuildSDF.st:46)


Now, IF the suggestion is to try the latest nightly 'stable-3.2'
snapshot
from github I downloaded that, installed the latest autoconf (2.69)
and the latest GNU m4 for use with autoconf (1.4.16) and ran "autoconf"
to build the configure script.  That went ok but when issuing the
./configure
I get it complaining about GST_REVISION which did NOT get expanded so
it
caused some syntax errors in the configure script.  So, I removed it
from the
configure.ac and after re-running autoconf I get :

configure: error: cannot find install-sh, install.sh, or shtool in
build-aux "."/build-aux

So -- if that is the method to travel to fix my bug above, what steps
are needed
to actually build a github snapshot?

Thx!!


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Exception handling issue..

Rick Flower-2
Ok.. Got past the last part -- I did notice the steps needed to build
the configure script.. I did find a few of my tools (automake,libtool)
were out of date..

By the way.. The tool prerequisites listed on the site below are not
quite right anymore...

http://smalltalk.gnu.org/download/cvs

The libtool reference for libtool-2.2 or later being sufficient is not
right.. I had 2.2.6 installed (not the 'a' or 'b' subversions) and
it did not work properly with regards to AC_PROG_LIBTOOL.. Once I moved
up to the latest version (2.4.2) that problem went away and the
configure
script was created w/o issue..

I'm still building the rest of the s/w to see if my exception issue is
still present or not..

Doh.. Ok.. Just ran across this after running the configure script :

Platform environment:
checking whether the host supports __sync_fetch_and_add... no
configure: error: Synchronization primitives not found, please use a
newer compiler.

Is this actually required?  Is there a way around it?  I'm using
gcc-4.1.0
and found a note indicating that it was provided in gcc-4.1 but it
seems like
a feature specific to Intel hardware perhaps -- not Solaris/Sparc..



_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Exception handling issue..

Rick Flower-2
In reply to this post by Rick Flower-2
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).


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Exception handling issue..

Paolo Bonzini-2
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).


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Exception handling issue..

Rick Flower-2
On 26.11.2012 03:56, Paolo Bonzini wrote:

> It seems that the MissingRequiredXMLDescriptorFile exception is not
> visible where you're trying to catch it.
>
> Perhaps it's in a different namespace?

Perhaps.. I was able to work around the issue and moved on to bigger
fish to fry.. :-)

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk