aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-02-16 18:05:47 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-02-16 18:05:47 +0000
commit61d9f92240373466e160867e97a5b4ea7af8c96e (patch)
treedb76f06a3fe1c2d549556aec562ed64af4dff347
parent95aaa63eedd48abbb8b5da3bccb3ec3332188c7a (diff)
downloadpaludis-61d9f92240373466e160867e97a5b4ea7af8c96e.tar.gz
paludis-61d9f92240373466e160867e97a5b4ea7af8c96e.tar.xz
Handle exceptions more gracefully.
-rw-r--r--src/clients/inquisitio/do_search.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index d255ebf..8617776 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -102,8 +102,8 @@ namespace
e != e_end ; ++e)
for (std::list<tr1::shared_ptr<Matcher> >::const_iterator m(matchers.begin()), m_end(matchers.end()) ;
m != m_end ; ++m)
- if ((**e)(**m, id))
- return true;
+ if ((**e)(**m, id))
+ return true;
return false;
}
@@ -129,13 +129,23 @@ namespace
for (std::list<tr1::shared_ptr<const PackageID> >::const_reverse_iterator i(sids.rbegin()), i_end(sids.rend()) ;
i != i_end ; ++i)
- if (e(**i))
+ {
+ try
+ {
+ if (e(**i))
+ {
+ if (invert_match ^ m(**i))
+ return *i;
+ else if (! all_versions)
+ return tr1::shared_ptr<const PackageID>();
+ }
+ }
+ catch (const Exception & ex)
{
- if (invert_match ^ m(**i))
- return *i;
- else if (! all_versions)
- return tr1::shared_ptr<const PackageID>();
+ Log::get_instance()->message(ll_warning, lc_context,
+ "Caught exception while handling '" + stringify(**i) + "': '" + ex.message() + "' (" + ex.what() + ")");
}
+ }
return tr1::shared_ptr<const PackageID>();
}