aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-07 16:06:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-07 16:06:02 +0000
commit46e553e7ac50359b77e8a4856320665e1c83fcdd (patch)
tree1f1ac4ac3af7b2ec7f4b6434dba060900931063b
parent2d5535b294c5e256313454e2657a84137eebc5f0 (diff)
downloadpaludis-46e553e7ac50359b77e8a4856320665e1c83fcdd.tar.gz
paludis-46e553e7ac50359b77e8a4856320665e1c83fcdd.tar.xz
Less fatal exceptions
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc57
1 files changed, 39 insertions, 18 deletions
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index 0912b9b..de10e50 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -110,12 +110,19 @@ QAController::_run_category(const CategoryNamePart & c)
{
using namespace tr1::placeholders;
- std::find_if(
- QAChecks::get_instance()->category_dir_checks_group()->begin(),
- QAChecks::get_instance()->category_dir_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(tr1::mem_fn(&CategoryDirCheckFunction::operator() ),
- _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->layout()->category_directory(c))));
+ try
+ {
+ std::find_if(
+ QAChecks::get_instance()->category_dir_checks_group()->begin(),
+ QAChecks::get_instance()->category_dir_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&CategoryDirCheckFunction::operator() ),
+ _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->layout()->category_directory(c))));
+ }
+ catch (const Exception & e)
+ {
+ _imp->reporter.message(qaml_severe, "category_dir_checks_group", "Caught exception '" + e.message() + "' (" + e.what() + ")");
+ }
tr1::shared_ptr<const QualifiedPackageNameSet> packages(_imp->repo->package_names(c));
parallel_for_each(packages->begin(), packages->end(), tr1::bind(&QAController::_run_package, this, _1));
@@ -133,12 +140,19 @@ void
QAController::_run_id(const tr1::shared_ptr<const PackageID> & i)
{
using namespace tr1::placeholders;
- std::find_if(
- QAChecks::get_instance()->package_id_checks_group()->begin(),
- QAChecks::get_instance()->package_id_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(tr1::mem_fn(&PackageIDCheckFunction::operator() ),
- _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i))));
+ try
+ {
+ std::find_if(
+ QAChecks::get_instance()->package_id_checks_group()->begin(),
+ QAChecks::get_instance()->package_id_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&PackageIDCheckFunction::operator() ),
+ _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i))));
+ }
+ catch (const Exception & e)
+ {
+ _imp->reporter.message(qaml_severe, "package_id_checks_group", "Caught exception '" + e.message() + "' (" + e.what() + ")");
+ }
}
void
@@ -146,12 +160,19 @@ QAController::run()
{
using namespace tr1::placeholders;
- std::find_if(
- QAChecks::get_instance()->tree_checks_group()->begin(),
- QAChecks::get_instance()->tree_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(tr1::mem_fn(&TreeCheckFunction::operator() ),
- _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->params().location)));
+ try
+ {
+ std::find_if(
+ QAChecks::get_instance()->tree_checks_group()->begin(),
+ QAChecks::get_instance()->tree_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&TreeCheckFunction::operator() ),
+ _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->params().location)));
+ }
+ catch (const Exception & e)
+ {
+ _imp->reporter.message(qaml_severe, "tree_checks_group", "Caught exception '" + e.message() + "' (" + e.what() + ")");
+ }
tr1::shared_ptr<const CategoryNamePartSet> categories(_imp->repo->category_names());
parallel_for_each(categories->begin(), categories->end(), tr1::bind(&QAController::_run_category, this, _1));