Today's Smalltalk Daily looks at basic excepton handling, introducing a few examples. The workspace code used in the screencast:
"Query an URL that does not answer"
[(HttpClient new get: 'http://wiki.cs.uiuc.edu/VisualWorks') contents]
on: OSErrorHolder needRetrySignal, OS.OSErrorHolder peerFaultSignal
do: [:ex | Transcript show: 'Timed out'; cr.
ex return]
"Divide by Zero"
[4/0]
on: ZeroDivide
do: [:ex | ex return: 0]
To watch, click on the viewer below:
If you have trouble viewing that directly, you can click here to download the video directly
You can also watch it on YouTube:
Technorati Tags:
smalltalk, exception handling, error handling