aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-force.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-24 00:25:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-24 17:11:47 +0300
commit6ce19c537bd9de8d3c9821841bc5ed680b762742 (patch)
tree2a487b1d5ec75b05e3001a461f149e14e5a859a8 /mod/mod-build-force.cxx
parent3363e1239973a66722f681999771964e39a98332 (diff)
Adapt to inventing package_name type
Diffstat (limited to 'mod/mod-build-force.cxx')
-rw-r--r--mod/mod-build-force.cxx12
1 files changed, 9 insertions, 3 deletions
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