]> git.tdb.fi Git - libs/net.git/blobdiff - source/request.cpp
Exception changes
[libs/net.git] / source / request.cpp
index 31e9c7c201959f158e6443556775d9bdfe4095eb..c948755ae78281cb1c36378de491a1cd0c948cd7 100644 (file)
@@ -27,7 +27,7 @@ Request Request::parse(const string &str)
        unsigned lf = str.find('\n');
        vector<string> parts = split(str.substr(0, lf-(str[lf-1]=='\r')), ' ', 2);
        if(parts.size()<3)
-               throw InvalidParameterValue("Invalid request");
+               throw invalid_argument("Request::parse");
 
        Request result(parts[0], parts[1]);
        result.http_version = parse_version(parts[2]);
@@ -43,7 +43,8 @@ Request Request::from_url(const string &str)
 {
        Url url = parse_url(str);
        if(url.scheme!="http")
-               throw InvalidParameterValue("Only http scheme is supported");
+               throw invalid_argument("Request::from_url");
+
        string path = url.path;
        if(path.empty())
                path = "/";