Errors, raise and catch signals

From Cuis CookBook
Jump to navigation Jump to search
  • This page collects a few snippets I find useful to pick up this topic
  • You make an error object like this:
Error new messageText: 'fooerr' 
  • For the Error to generate an 'error signal' you do
Error new messageText: 'fooerr' ; signal
  • You can define your own errors subclassing Error and maybe adding a default messageText and tag.
  • Example of catching a risen Error signal
[ Error new messageText: 'fooerr' ; signal  ] on: Error do: [ 
	Transcript log: 'foobar'. 
	].