[Seaside-dev] Seaside and exception behaviour
mkobetic at cincom.com
mkobetic at cincom.com
Wed Jan 5 15:08:46 UTC 2011
Here's maybe a bit more concise example. If you run the thing below in a workspace,
it should return 'Squeak' in Squeak and 'VW' in VW
[ [ [ self error: 'trigger error'
] on: ZeroDivide do: [ :ex | 'Squeak' ]
] on: Error do: [ :ex | 3 / 0 ]
] on: ZeroDivide do: [ :ex | 'VW' ]
HTH,
Martin
"Alan Knight"<knight at acm.org> wrote:
> To more concretely illustrate what I'm talking about, consider defining
> an exception class ExceptionOne. Then define a class First with a method
> startHere
> "First new startHere"
> [Second new doStuff] on: Error do: [:ex | Transcript cr; show:
> 'exception in startHere'. ExceptionOne signal].
>
> And a class Second, with
> doStuff
> [self doMoreStuff] on: ExceptionOne do: [:ex | Transcript cr; show:
> 'Exception in doStuff'].
>
> and
>
> doMoreStuff
> Transcript cr; show: 'Doing more stuff...'.
> 3 / 0.
>
> In VisualWorks and VisualAge that results in an uncaught ExceptionOne
> and a debugger. In Pharo 1.1 one-click it just prints 3 things to the
> Transcript, the same behaviour I'd get in VisualWorks if I change the
> startHere method to do "ex resiganlAs: ExceptionOne new"
>
> --
> Alan Knight [|], Engineering Manager, Cincom Smalltalk
> knight at acm.org
> aknight at cincom.com
> http://www.cincom.com/smalltalk
>
>
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
More information about the seaside-dev
mailing list