85 template<
typename N >
86 class vxt :
public std::runtime_error
118 if ( !
file.empty() )
120 std::ostringstream ss;
121 ss <<
" [" <<
file <<
":" <<
line <<
"]";
122 buff.append( ss.str() );
139 std::ostringstream ss;
144 ptr += ss.str().length();
148 buff.append( ss.str() );
158 virtual const char *
what()
const throw()
166 static std::vector< std::string >snames;
167 if ( snames.size() == 0)
169 snames.push_back(
"Emergency" );
170 snames.push_back(
"Alert" );
171 snames.push_back(
"Critical" );
172 snames.push_back(
"Error" );
173 snames.push_back(
"Code" );
174 snames.push_back(
"Warning" );
175 snames.push_back(
"Notice" );
176 snames.push_back(
"Info" );
177 snames.push_back(
"Debug" );
179 return snames[(int)s];
196 #define VX(x) vx(x, __FILE__, __LINE__ )
The program cannot continue.
Definition: except.h:59
Severity severity()
get the severity of the exception
Definition: except.h:155
virtual const char * what() const
get the message from the exception
Definition: except.h:158
std::string file
source file from which it was thrown
Definition: except.h:91
static const std::string & sevToString(Severity s)
Convert a severity into a string.
Definition: except.h:164
The program cannot continue and may have corrupted its data.
Definition: except.h:58
Information messages.
Definition: except.h:63
int line
line number in the source file
Definition: except.h:92
vxt(Severity s, const std::string &f, int ln)
constructor
Definition: except.h:113
A fault has been detected which may compromise the computer.
Definition: except.h:56
An exception object with severity levels.
Definition: except.h:86
vxt & operator<<(T x)
Provide stream syntax for the exception object.
Definition: except.h:137
vxt(Severity s)
constructor
Definition: except.h:100
Severity mSeverity
severity level of the exception
Definition: except.h:89
A programming error has been detected.
Definition: except.h:60
A configuration error has been detected.
Definition: except.h:57
Severity
Severity levels for log messages.
Definition: except.h:55
std::string buff
message built into this
Definition: except.h:90
There is a problem but the program can continue.
Definition: except.h:61
Something is odd.
Definition: except.h:62
int ptr
insertion point for message text
Definition: except.h:93
Debugging messages.
Definition: except.h:64