Joel VanderWerf
11/9/2007 2:20:00 AM
ara.t.howard wrote:
> a) let the exception pass through. this is ok if, and only if, there is
> nothing reasonable your code could do to retry. if you do retry you
> have you have a configurable numbmer of retries, of course.
>
> b) wrap the errors. my preferred approach is something like
Another possibility, somewhere between a and b: rescue the exception and
re-raise, but add some more information to the message. That extra info
might be, for example, IP address and port during network operations.
This doesn't change the structure of exception handling, since the
Exception subclass is the same and it will be handled at the same point,
eventually, but it can be very useful for logging/debugging and for
presenting an informative message to the user, if your program is
interactive.
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407