I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source. Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g. ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing? seb
Oh if only!!! I love this idea, and comments haev coem from DC along those same lines, btu nothing ever really happened about it... cheers, Chris seb bacon wrote:
I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source.
Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g.
ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException
Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing?
seb
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
<snip good idea about exception hierarchies>
Oh if only!!!
I love this idea, and comments haev coem from DC along those same lines, btu nothing ever really happened about it...
If there are people willing to work on this, then a proposal would be most welcome... http://dev.zope.org/Wikis/DevSite/Proposals/FrontPage Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
On 11/10/2000 9:45 AM, "seb bacon" <seb@jamkit.com> wrote:
I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source.
Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g.
ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException
Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing?
Some folks here are in the process of modeling the internals of Zope, one purpose of which was to identify the Exception tree and ensure we had a good hierarchy. The "Bad Request" exception is used as part of ZPublishers ability to raise HTTP Errors, and it *might* just be bad habit on some of us old Bobo coders. Jeffrey P Shell, jeffrey@Digicool.com http://www.digicool.com/ | http://www.zope.org
I think that this would make a great dev.zope.org fish-bowl project. I'd love to see someone come up with an exception model for Zope: - arranging exceptions in a hierarchy. - defining standard APIs for exceptions. To give an example of what I'd like to gain by having exception APIs, I'd like there to be ab API for finding out whether an exception is meant for a human and getting an exception as HTML, so we stop embedding markup in exception values to indicate errors meant for humans. Any volunteers? :) Jim seb bacon wrote:
I was just building in some error handling into some UI code, and wanted to catch errors relating to duplicate ids. The problem is that just about every client-side error raises the same kind of Exception, a 'Bad Request'. A quick grep counted 41 different types of 'Bad Request' in my Zope source.
Wouldn't it be *much* nicer to have a hierarchy of exception types, so that applications can deal with them at an arbitrarily granular level? e.g.
ZopeException | `RequestException | | | `XMLException | `IdException | | | `ReservedWordException | `DuplicateException
Has this discussion taken place before? Would it be useful? Would its effort:benfits ratio be too great to justify doing?
seb
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
participants (5)
-
Brian Lloyd -
Chris Withers -
Jeffrey P Shell -
Jim Fulton -
seb bacon