From 6ce19c537bd9de8d3c9821841bc5ed680b762742 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 24 May 2018 00:25:45 +0300 Subject: Adapt to inventing package_name type --- mod/mod-build-force.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mod/mod-build-force.cxx') diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx index da063ea..af47b4c 100644 --- a/mod/mod-build-force.cxx +++ b/mod/mod-build-force.cxx @@ -77,10 +77,16 @@ handle (request& rq, response& rs) try { - string& p (params.package ()); + package_name p; - if (p.empty ()) - throw invalid_argument ("empty package name"); + try + { + p = package_name (move (params.package ())); + } + catch (const invalid_argument& e) + { + throw invalid_argument (string ("invalid package name: ") + e.what ()); + } // We accept the non-url-encoded version representation. Note that the // parameter is already url-decoded by the web server, so we just restore -- cgit v1.1