[Pharo-project] Improving Pharo's Exception Hierarchy

Henrik Sperre Johansen henrik.s.johansen at veloxit.no
Thu Apr 14 21:04:42 CEST 2011


On 14.04.2011 20:52, Dale Henrichs wrote:
> Stef,
>
> For rangeError the code would look like this:
>
>   [
>   (NumericError new)
>     reason: #rangeError;
>     signal: 'access out of bounds'
>   ]
>     on: NumericError
>     do: [:ex |
>       ex reasonCode == #rangeError
>         ifTrue: [ "do your thang" ]
>         ifFalse: [ ex pass ]].
>
> Dale

Why not use #tag, which is already ANSI?

Cheers,
Henry



More information about the Pharo-project mailing list