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-version-details.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'mod/mod-package-version-details.cxx') diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index 796f9e6..0da9678 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -89,20 +89,19 @@ handle (request& rq, response& rs) full = params.form () == page_form::full; } - catch (const unknown_argument& e) + catch (const cli::exception& e) { throw invalid_request (400, e.what ()); } - auto url ( - [&sver](bool f = false, const string& a = "") -> string - { - string u (sver); + auto url = [&sver] (bool f = false, const string& a = "") -> string + { + string u (sver); - if (f) { u += "?f=full"; } - if (!a.empty ()) { u += '#' + a; } - return u; - }); + if (f) { u += "?f=full"; } + if (!a.empty ()) { u += '#' + a; } + return u; + }; const string title (name + " " + sver); xml::serializer s (rs.content (), title); -- cgit v1.1