aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-package-search.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-03-16 12:51:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-03-16 12:51:24 +0300
commitbed7ade3fa57ef3a7d4e8bd99c35aecb1f414bed (patch)
treeba2158ffeea2e23d7150566bc9773bdbb060ab93 /mod/mod-package-search.cxx
parentf0c834ed57ef3afbbed2a4baacbab19fe6e7a6fd (diff)
Fix brep module to properly handle request parameters parsing exceptions
Diffstat (limited to 'mod/mod-package-search.cxx')
-rw-r--r--mod/mod-package-search.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/mod/mod-package-search.cxx b/mod/mod-package-search.cxx
index 0fecc0a..6f13eb2 100644
--- a/mod/mod-package-search.cxx
+++ b/mod/mod-package-search.cxx
@@ -96,7 +96,7 @@ handle (request& rq, response& rs)
params = params::package_search (
s, unknown_mode::fail, unknown_mode::fail);
}
- catch (const unknown_argument& e)
+ catch (const cli::exception& e)
{
throw invalid_request (400, e.what ());
}
@@ -146,12 +146,12 @@ handle (request& rq, response& rs)
// Enclose the subsequent tables to be able to use nth-child CSS selector.
//
s << DIV;
- for (const auto& pr:
- db_->query<latest_package_search_rank> (
- search_param<latest_package_search_rank> (squery) +
- "ORDER BY rank DESC, name" +
- "OFFSET" + to_string (page * res_page) +
- "LIMIT" + to_string (res_page)))
+ for (const auto& pr:
+ db_->query<latest_package_search_rank> (
+ search_param<latest_package_search_rank> (squery) +
+ "ORDER BY rank DESC, name" +
+ "OFFSET" + to_string (page * res_page) +
+ "LIMIT" + to_string (res_page)))
{
shared_ptr<package> p (db_->load<package> (pr.id));