1 #ifndef UTIL_FORMAT_EXCEPTIONS_H
2 #define UTIL_FORMAT_EXCEPTIONS_H
7 class format_error
: public std::exception
{
10 virtual const char *what() const throw() {
11 return "Format::format_error: format generic failure";
15 class bad_format_string
: public format_error
{
17 bad_format_string() {}
18 virtual const char *what() const throw() {
19 return "Format::bad_format_string: format-string is ill-formed";
23 class too_few_args
: public format_error
{
26 virtual const char *what() const throw() {
28 return "Format::too_few_args: format-string refered to more arguments than were passed";
34 class too_many_args
: public format_error
{
37 virtual const char *what() const throw() {
38 return "Format::too_many_args: format-string refered to less arguments than were passed";
42 class out_of_range
: public format_error
{
45 virtual const char *what() const throw() {
46 return "Format::out_of_range: "
47 "tried to refer to an argument (or item) number which is out of range, "
48 "according to the format string.";