BIND 10 #1857: make isc::config::ModuleSpecError a derived class of isc::Exception
BIND 10 Development
do-not-reply at isc.org
Wed Mar 28 23:18:12 UTC 2012
#1857: make isc::config::ModuleSpecError a derived class of isc::Exception
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: defect | Status: new
Priority: medium | Milestone: Next-
Component: | Sprint-Proposed
configuration | Keywords:
Sensitive: 0 | Defect Severity: N/A
Sub-Project: DNS | Feature Depending on Ticket:
Estimated Difficulty: 0 | Add Hours to Ticket: 0
Total Hours: 0 | Internal?: 0
-------------------------------------+-------------------------------------
Currently it's a direct derived class of std::exception:
{{{#!c++
/// A standard ModuleSpec exception that is thrown when a
/// specification is not in the correct form.
///
/// TODO: use jinmei's exception class as a base and not c_str in
/// what() there
class ModuleSpecError : public std::exception {
public:
ModuleSpecError(std::string m = "Module specification is invalid")
: msg(m) {}
~ModuleSpecError() throw() {}
const char* what() const throw() { return (msg.c_str()); }
private:
std::string msg;
};
}}}
As noted in the comment we should make it a derived class of
isc::Exception. We often consider other std::exception outside of
isc::Exception as a fatal error, so this can affect stability in case
an error happens.
Implementation-wise, this should be a trivial cleanup.
--
Ticket URL: <http://bind10.isc.org/ticket/1857>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list