BIND 10 #2394: clarify the use case for some basic exceptions
BIND 10 Development
do-not-reply at isc.org
Fri Oct 19 21:02:13 UTC 2012
#2394: clarify the use case for some basic exceptions
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: defect | Status: new
Priority: medium | Milestone: New
Component: Unclassified | Tasks
Sensitive: 0 | Keywords:
Sub-Project: Core | Defect Severity: N/A
Estimated Difficulty: 0 | Feature Depending on Ticket:
Total Hours: 0 | Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
As discussed in #2207 (see, e.g., the relevant part of
http://bind10.isc.org/ticket/2207#comment:14), it the intended usage
of the some exceptions defined exceptions/exceptions.h
doesn't seem clear and different developers use it for different
purposes.
That's particularly so for `Unexpected`. When I first introduced it
(I believe it was me who added it), I intended it to mean really
"exceptional" events where we'd rather assert() the condition. An
example (not limited to that) would be failure of some system level
API that would basically be expected to succeed. Another case is an
indication of inconsistent state of a class but when we cannot 100%
eliminate the possibility that it's triggered by a (misbehaving)
application. Something like `Unexpected` tends to be a kitchen sink
(after all, any exception should generally indicate an "unexpected"
event, isn't it?), so I wanted to limit the use case of it.
Whether or not this intent makes sense, the reality in our code is
that it's used for other purposes like when an application passes a
NULL pointer when it shouldn't. So, there's at least some confusion
here.
The bottom line goal of this ticket is to document the intended
purpose of `Unexpected`. If there are other confusing exception
types, we should also clarify it in documentation.
Then, my personal proposal for `Unexpected` is the one I originally
intended as described above. But we can discuss that.
I also suggest unifying `InvalidParameter` and `BadValue` in this
ticket. I don't remember how we end up having these two, but it
doesn't make sense to me to separate these cases (I actually don't
even understand what's the difference between these).
--
Ticket URL: <https://bind10.isc.org/ticket/2394>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list