From a268ee8d1990eca21155137d0245b2985579d064 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 9 Jun 2011 17:07:55 +0300 Subject: [PATCH] Exception changes in strings/utils.cpp --- source/strings/utils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/strings/utils.cpp b/source/strings/utils.cpp index 93bbbbf..fff6cdb 100644 --- a/source/strings/utils.cpp +++ b/source/strings/utils.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include "utils.h" using namespace std; @@ -148,7 +148,7 @@ string c_unescape(const std::string &str) else if(*i>='A' && *i<='F') digit = *i-'A'+10; else - throw InvalidParameterValue("Invalid hexadecimal digit"); + throw invalid_argument("c_unescape"); numeric_value = (numeric_value<<4 | digit); ++numeric_pos; @@ -164,7 +164,7 @@ string c_unescape(const std::string &str) if(*i>='0' && *i<='7') digit = *i-'0'; else - throw InvalidParameterValue("Invalid octal digit"); + throw invalid_argument("c_unescape"); numeric_value = (numeric_value<<3 | digit); ++numeric_pos; @@ -209,7 +209,7 @@ string c_unescape(const std::string &str) else if(*i=='\\') result += '\\'; else - throw InvalidParameterValue("Invalid escape sequence"); + throw invalid_argument("c_unescape"); escape = false; } @@ -220,7 +220,7 @@ string c_unescape(const std::string &str) } if(escape) - throw InvalidParameterValue("Stray backslash at end of string"); + throw invalid_argument("c_unescape"); return result; } -- 2.43.0