if(c=='%')
{
if(i+3>str.size())
- throw InvalidParameterValue("Malformed data");
+ throw invalid_argument("urldecode");
result += lexical_cast<unsigned char>(str.substr(i+1, 2), "x");
i += 2;
}
return url;
}
else
- throw InvalidParameterValue("Invalid URL");
+ throw invalid_argument("parse_url");
}
string build_url(const Url &url)
{
if(!url.path.empty() && url.path[0]!='/')
- throw InvalidParameterValue("Only absolute paths are supported");
+ throw invalid_argument("build_url");
+
string str;
if(!url.scheme.empty())
str += url.scheme+"://";