aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-18 11:44:39 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-18 11:44:39 +0000
commitbe6726ff0f9abb0fe8d9b6d337771e61c0dfa14e (patch)
treec65a01dd6f24ddb8824cbb8b2c18d89fe4765d5f
parentd28888a75c5b3a5aa91240eeb963056c8862c132 (diff)
downloadpaludis-be6726ff0f9abb0fe8d9b6d337771e61c0dfa14e.tar.gz
paludis-be6726ff0f9abb0fe8d9b6d337771e61c0dfa14e.tar.xz
(python) Fail when base exception is not found.
-rw-r--r--python/exception.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/exception.cc b/python/exception.cc
index 1915c25..f95522a 100644
--- a/python/exception.cc
+++ b/python/exception.cc
@@ -23,6 +23,8 @@
#include <python/paludis_python.hh>
#include <map>
+#include <iostream>
+
using namespace paludis;
using namespace paludis::python;
namespace bp = boost::python;
@@ -65,7 +67,10 @@ ExceptionRegister::get_py_exception(const std::string & name)
if (i != _imp->exceptions.end())
return i->second->get_py_exception();
else
- return NULL;
+ {
+ std::cerr << "Exception '" << name << "' not found." << std::endl;
+ throw PythonError("Exception '" + name + "' not found.");
+ }
}
PythonError::PythonError(const std::string & message) throw () :