Re: [Windows] Associate file extensions with a program
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Oct 13, 2004
- 469 views
Pete Lomax wrote: > > Juergen Luethje wrote: > > > I can see that implementation #1 is not a good idea, but what about > > implementation #2? > > If there is an error in proc1, such as FileDoesNotExist, then it would > not help matters to replace this with ErrorWritingToFile in proc2. > > In fact, wouldn't most error conditions tend to daisy-chain? Yes. It's important to allow for errors to propagate back up through the call chain. I've done this a couple of different ways in EuSQL and in matheval. In EuSQL, all functions return a sequence on success, and an integer on failure. After pretty much every call from a library routine to another, I check this condition, and simply return the error code. There is also an extended error message that can be set, and that an application can request. In matheval, I defined a separate type, called INVALID. Each matheval type is smart enough to only operate on other types that it understands, so the INVALID type is simply passed back. Part of the INVALID type is an error message. Matt Lewis