diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-16 12:51:24 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-16 12:51:24 +0300 |
commit | bed7ade3fa57ef3a7d4e8bd99c35aecb1f414bed (patch) | |
tree | ba2158ffeea2e23d7150566bc9773bdbb060ab93 /mod/mod-package-version-details.cxx | |
parent | f0c834ed57ef3afbbed2a4baacbab19fe6e7a6fd (diff) |
Fix brep module to properly handle request parameters parsing exceptions
Diffstat (limited to 'mod/mod-package-version-details.cxx')
-rw-r--r-- | mod/mod-package-version-details.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
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); |