ANSI Exceptions support bug?

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

ANSI Exceptions support bug?

Gabriel Cotelli
Hi,

executing this in a workspace raises an error:
| result |

result :=
[
ZeroDivide dividend: 1.
Warning signal]
on: (Warning , ZeroDivide) , (MessageNotUnderstood , Error)
do: [:ex | ex resume: 1].

result = 1

I've checked and works Ok in Pharo and GemStone/S.
The problem seems to be related to the way ExceptionSet implements , . Probably a doubleDispatch with the "anotherException" to do different things if it's an ExceptionSet or an Exception could do the trick.

Regards,
Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
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: ANSI Exceptions support bug?

John O'Keefe-3
Gabriel -
 
You are correct, anExceptionSet is a valid <exceptionSelector> and so should be accepted as the argument to ExceptionSet>>#, -- I've opened case 48480 for it.  I'll post the fix here.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
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: ANSI Exceptions support bug?

John O'Keefe-3
Gabriel -
 
Try the attached file-in.  The following 4 situations all should work correctly now:
  1. anExceptionSet, Exception
  2. Exception, anExceptionSet
  3. Exception, Exception
  4. anExceptionSet, anExceptionSet

John

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
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.

case48480a.st (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ANSI Exceptions support bug?

Gabriel Cotelli
Hi John, 
I tested the attached file out and worked ok. However previously I've been able to mix Class-Based and Instance-Based exceptions, like: "Error, ExError" and this worked but now this raises an error. Maybe the extension is missing in ExceptionalEvent ?

Regards,
Gabriel

--
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/-/Q0Z1V0FFQU1VSllK.
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: ANSI Exceptions support bug?

John O'Keefe-3
Gabriel -
 
Yes, actually both ExceptionalEvent and ExceptionalEventCollection :-(
 
I've uploaded a new version of the patch (including the content of the old patch, so this patch is a complete replacement).
 
I think you will also need another patch from case 48204 (fixed in February) which updated ExceptionalEventCollection>>#handle:do:
handle: protectedBlock do: handlerBlock
"Polymorphic with class-based ExceptionSet"
 
^ protectedBlock when: self do: handlerBlock
If you still have a problem after applying these 2 patches, please post an example of the failing code.
 
John
 
 
:

--
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/-/cLORokyI0W0J.
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.

case48480b.st (6K) Download Attachment