Errors, raise and catch signals
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 defaultmessageText
andtag
. - Example of catching a risen Error signal
[ Error new messageText: 'fooerr' ; signal ] on: Error do: [ Transcript log: 'foobar'. ].