From: <ec...@we...> - 2006-11-03 12:46:41
|
> Actually, as the author of [using] and several other control > constructs, I can say that you definitely do end up catching > everything just to rethrow errors again. Apart from being essential > in order to clean up resources (i.e., equivalent of a "finally" > clause), it is also necessary if you want to catch "break" or > "continue" exceptions. This isn't some obscure corner case: any time > you want to [catch] anything you have to catch everything and then > rethrow those exceptions you don't know how to deal with. You mean things like this?: set err [catch {...} m] switch -- $err { 1 {do this} 2 {do that} default {return -code $err "Hae? $m"} } It means that you expect return codes 1 and 2, but everything else is not expected and thus rethrown. An errorhandler on -uncaught woud pitch in for the "default" branch above. It helps you not to find out where and how the error exactly happened in the catch {} block, although it helps you certainly to see how it came there. This makes me think whether it might be useful to register custom handlers for different return codes... Eckhard _____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000066 |