]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/format.cpp
Exception changes for Fmt and Formatter
[libs/core.git] / source / strings / format.cpp
index dfd3800841033cbafba518b9b1417f193c30ab77..4fa5e2caeaf3eac74f1d1d42bc49625f2e642f2c 100644 (file)
@@ -25,7 +25,7 @@ values have been fed to the formatter.
 const string &Formatter::str() const
 {
        if(pos!=fmt.end())
-               throw Exception("Too few arguments for format");
+               throw format_error("Too few arguments for format");
 
        return result;
 }
@@ -43,7 +43,7 @@ void Formatter::advance()
                {
                        ++pos;
                        if(pos==fmt.end())
-                               throw Exception("Malformed format string");
+                               throw format_error("Malformed format string");
                        if(*pos!='%')
                                break;
                }
@@ -59,7 +59,7 @@ Fmt object.
 Fmt Formatter::get_conversion()
 {
        if(pos==fmt.end())
-               throw Exception("Too many arguments for format");
+               throw format_error("Too many arguments for format");
 
        string::iterator i = pos;
        for(; i!=fmt.end(); ++i)
@@ -67,7 +67,7 @@ Fmt Formatter::get_conversion()
                        break;
 
        if(i==fmt.end())
-               throw Exception("Malformed format string");
+               throw format_error("Malformed format string");
 
        ++i;
        string c(pos, i);