aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-16 12:40:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-16 12:40:13 +0000
commit3fe70cd0ba5e9d26acd171abce113f44c3091d48 (patch)
tree511181b780463c8325342208ae4cec5f7113fbd2
parent39005c38ee51c18fd89c81803ad3c230640868e4 (diff)
downloadpaludis-3fe70cd0ba5e9d26acd171abce113f44c3091d48.tar.gz
paludis-3fe70cd0ba5e9d26acd171abce113f44c3091d48.tar.xz
Use a proper exception rather than InternalError for weird version operators
-rw-r--r--paludis/version_operator.cc6
-rw-r--r--paludis/version_operator.hh7
2 files changed, 12 insertions, 1 deletions
diff --git a/paludis/version_operator.cc b/paludis/version_operator.cc
index 84245d8..61d82e3 100644
--- a/paludis/version_operator.cc
+++ b/paludis/version_operator.cc
@@ -55,7 +55,7 @@ VersionOperator::_decode(const std::string & v)
}
}
- throw InternalError(PALUDIS_HERE, "todo"); /// \bug
+ throw BadVersionOperatorError(v);
}
std::ostream &
@@ -131,3 +131,7 @@ bool (VersionSpec::* VersionOperator::as_version_spec_operator() const)(const Ve
throw InternalError(PALUDIS_HERE, "_v is " + stringify(_v));
}
+BadVersionOperatorError::BadVersionOperatorError(const std::string & msg) throw () :
+ Exception("Bad version operator '" + msg + "'")
+{
+}
diff --git a/paludis/version_operator.hh b/paludis/version_operator.hh
index 3ed3472..ba28579 100644
--- a/paludis/version_operator.hh
+++ b/paludis/version_operator.hh
@@ -111,6 +111,13 @@ namespace paludis
bool (VersionSpec::* as_version_spec_operator() const)(const VersionSpec &) const;
};
+ class BadVersionOperatorError :
+ public Exception
+ {
+ public:
+ BadVersionOperatorError(const std::string & msg) throw ();
+ };
+
/**
* A VersionOperator can be written to an ostreams
*/