Not catching Exceptions

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

Not catching Exceptions

Brad Selfridge
Is there a way to signal an exception and NOT have it caught?  But if one would create a "when:do:" on the exception then then exception would be caught. I had a working process built using a subclass on the "Notification" class on 6.04, but it does not work on 8.04.   I check the documentation and there is nothing about NOT wanting to catch an exception.

I know that one can always catch and exception and then ignore it. I want to implement a solution that doesn't force a developer to have to code for the exception.

Thanks,

Brad Selfridge

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/eHTL92Ll8acJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Brad Selfridge
Reply | Threaded
Open this post in threaded view
|

Re: Not catching Exceptions

dmacq
Hi Brad,

Why would you want to 'signal an exception and NOT have it caught?'   It is not clear what you are trying to do here.

I suggest you post your 6.04 code as an attachment. That would make it easier to help you.

hth,

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/nFKrDq-PF2AJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Not catching Exceptions

Brad Selfridge
Donald,

My thought process was to write a framework that allowed the developer to decide whether to listen and catch a notification or not. Just because one is thrown, doesn't mean that they care about catching it.  While writing server code, it was always a pain in the arse to HAVE to catch an exception, even though you weren't interested in it and then throw it away and proceed on anyway.  It's like someone says "Everybody - supper is ready", but if no one is hungry then they can ignore it.


Here is the OGLoggerApp. It contains the "FatalNotification" notification class that seems to work as desired in 6.04, but not in 8.03.  All documentation is in the OGLoggerApp notes section.  Once I can get the  "FatalNotification" class to work on 8.03, I'll load it into the Goodies.

Brad

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/uEMppylOx6oJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

OGLoggerApp.dat (188K) Download Attachment
Brad Selfridge
Reply | Threaded
Open this post in threaded view
|

Aw: Re: Not catching Exceptions

jtuchel
Brad,

I am not sure if I understand fully what you mean, but to me there seems to be not much of a difference between building some way of ignoring certain exceptions in a handler block or building some extra framework. Both seem to come at a cost. Why not handle a special kind of exception depending on some flag?

Your example with "Supper's ready" is a bit strange: The one who announces it wants to let people know about it and maybe react to it accordingly. The same is true for exceptions. So why implement something extra that comes with the danger of breaking Exception handling in all kinds of ways?

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/qOsGFR3xVu8J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Aw: Re: Not catching Exceptions

jtuchel
Brad,

just another idea: maybe you are not wanting Exceptions at all, but Announcements to which you can subscribe or not. There is Vassily Bykov's Announcements Framework for such situations. It's an implementation of Publish/Subscribe and has been used by many Smalltalkers in all kinds of ST flavors over the years. You can Download a VAST version from VASTGoodies.com

HTH

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/g1jp8pBxjyIJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Not catching Exceptions

Richard Sargent (again)
In reply to this post by Brad Selfridge
It sounds like you want to implement an override for Exception>>#defaultAction in your exception subclass. (ExceptionalEvent has a #defaultHandler: for the same purpose.

In other words, the designer of the exception controls what happens if there is no explicit handler for an exception. Notification>>#defaultAction simply returns nil.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/MSA9ig_I1loJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Not catching Exceptions

Brad Selfridge
Thanks for everyone's support and suggestions. I think that I've solved my problem.

I had created a subclass of Signal and was trying to catch a signal message with a Block>>#when:do: method. I did not realize that 8.03 has implemented the Block>>#on:do method which is new behavior from 6.04. 

I been working on 6.04 and have NOT had any access to 8.03 before now.  Looks like I've got some learning to do.

Thanks again,

Brad Selfridge

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/jEjMHyRqV1oJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Brad Selfridge