| Joel Uckelman on Thu, 23 Dec 2004 17:12:24 -0600 (CST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: [nimh-dev] exceptions |
Thus spake "Jon Stewart": > > Having only the one exception in mhlib is already becoming a nuisance in > > trying to extend it. It's awkward to trap for different errors when they're > > > all of type Error and the only thing that differentiates them is their > > associated text. > > > > I think I'm going to start adding some error classes, like > > BadMessageListError and EmptySequenceError. > > > I agree with this. Checking type information is a far better practice than > checking text. > And on the 23rd day named exceptions were created, and they were Good. I'm collecting the named errors in Error.py. They're organized by the thing that's having the malfunction, and named in such a way that you should be able to tell what the error is from its name. Of course, rename them if you can think of better names. -- J. _______________________________________________ nimh-dev mailing list nimh-dev@xxxxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/nimh-dev