From bed7ade3fa57ef3a7d4e8bd99c35aecb1f414bed Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Mar 2017 12:51:24 +0300 Subject: Fix brep module to properly handle request parameters parsing exceptions --- mod/mod-package-search.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mod/mod-package-search.cxx') 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 ( - search_param (squery) + - "ORDER BY rank DESC, name" + - "OFFSET" + to_string (page * res_page) + - "LIMIT" + to_string (res_page))) + for (const auto& pr: + db_->query ( + search_param (squery) + + "ORDER BY rank DESC, name" + + "OFFSET" + to_string (page * res_page) + + "LIMIT" + to_string (res_page))) { shared_ptr p (db_->load (pr.id)); -- cgit v1.1