From: David N. W. <da...@de...> - 2005-09-23 09:28:31
|
Will Duquette wrote: > David, > > I think the current behavior (letting the error bubble up to > bgerror) is the correct one. Suppose I supply a command to a > library module, and there's an error in my command's implementation. > For debugging, I want access to the errorInfo. If the library > module catches the error, I lose that errorInfo--unless the library > module stashes it somewhere, which isn't standard behavior. It should be standard behavior. What if you have several library modules that might generate background errors? What if you're running them in a GUI where you really don't want the end user to see them 'raw'? Then you have potential problems. > In an application that can log errors thoroughly it's reasonable > to catch such errors and write them to the log; but in > general-purpose library code, letting the error bubble-up to bgerror > is the easiest way to get the debugging info to the developer. > At most, the library might want to catch the error and rethrow it. It's easier, but providing an error handling hook is more correct because of the robustness it gives your applications. Of course, to keep things 'easy', you could just make the default behavior call bgerror so that nothing changes. Ciao, -- David N. Welton - http://www.dedasys.com/davidw/ Apache, Linux, Tcl Consulting - http://www.dedasys.com/ |