exception handling

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

exception handling

Mark Volkmann
Can someone point me to an example of how to raise and handle  
exceptions in Squeak Smalltalk? My Googling came up empty.

---
Mark Volkmann




_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: exception handling

NorbertHartl
On Thu, 2008-09-25 at 17:26 -0500, Mark Volkmann wrote:
> Can someone point me to an example of how to raise and handle  
> exceptions in Squeak Smalltalk? My Googling came up empty.
>
[
  Transcript show: 'Here it is shown...'.
  (Exception new messageText: 'and there it is thrown') signal
]
  on: Exception
  do: [:x| Transcript show: x messageText ]

Norbert

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: exception handling

Tapple Gao
In reply to this post by Mark Volkmann
On Thu, Sep 25, 2008 at 05:26:22PM -0500, Mark Volkmann wrote:
> Can someone point me to an example of how to raise and handle  
> exceptions in Squeak Smalltalk? My Googling came up empty.

Look at class Exception. Here are a couple of doits to get you
started. Try printing them:

[self error: 'haha'] on: Error do: [:ex | ex return: ex messageText].
ArithmeticError signal.

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners