Category:Smalltalk: Difference between revisions

Line 543:
 
Handlers can also be defined to handle a collection of non-related exceptions, by creating an exceptionSet:
<lang smalltalk>[ try block to be evaluated ] on: (ZeroDivide, DomainError) do:[:ex | handler ]</lang>
finally, many dialects provide syntactic sugar for common situations:
<lang smalltalk>exception catch: [ action ] "to return out of the action, without any particular handler action"
Anonymous user