]> git.tdb.fi Git - libs/net.git/blobdiff - source/utils.cpp
Exception changes
[libs/net.git] / source / utils.cpp
index 0803c14c74edc980951e50b8c960ebcb94481622..5a5dc0487c0f1bf4dbd9132143e14567d7c30574 100644 (file)
@@ -65,7 +65,7 @@ string urldecode(const string &str)
                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;
                }
@@ -91,13 +91,14 @@ Url parse_url(const string &str)
                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+"://";