78 template<
typename N >
79 class vxt :
public std::runtime_error
112 if ( !
file.empty() )
114 std::ostringstream ss;
115 ss <<
" [" <<
file <<
":" <<
line <<
"]";
116 buff.append( ss.str() );
133 std::ostringstream ss;
138 ptr += ss.str().length();
142 buff.append( ss.str() );
152 virtual const char *
what()
const throw()
160 static std::vector< std::string >snames;
161 if ( snames.size() == 0)
163 snames.push_back(
"Emergency" );
164 snames.push_back(
"Alert" );
165 snames.push_back(
"Critical" );
166 snames.push_back(
"Error" );
167 snames.push_back(
"Code" );
168 snames.push_back(
"Warning" );
169 snames.push_back(
"Notice" );
170 snames.push_back(
"Info" );
171 snames.push_back(
"Debug" );
173 return snames[(int)s];
210 #define VX(x) vx(x, __FILE__, __LINE__ )
An exception object with severity levels.
Definition: vx.h:79
vxt(Severity s, const std::string &f, int ln)
constructor
Definition: vx.h:107
std::string buff
message built into this
Definition: vx.h:84
Severity
Severity levels for log messages.
Definition: vx.h:48
std::string file
source file from which it was thrown
Definition: vx.h:85
A programming error has been detected.
Definition: vx.h:53
virtual const char * what() const
get the message from the exception
Definition: vx.h:152
vxt & operator<<(T x)
Provide stream syntax for the exception object.
Definition: vx.h:131
static const std::string & sevToString(VICI::Severity s)
Convert a severity into a string.
Definition: vx.h:158
The program cannot continue.
Definition: vx.h:52
A configuration error has been detected.
Definition: vx.h:50
Severity severity()
get the severity of the exception
Definition: vx.h:149
The program cannot continue and may have corrupted its data.
Definition: vx.h:51
Debugging messages.
Definition: vx.h:57
A fault has been detected which may compromise the computer.
Definition: vx.h:49
Something is odd.
Definition: vx.h:55
vxt(Severity s)
constructor
Definition: vx.h:94
Severity mSeverity
severity level of the exception
Definition: vx.h:83
There is a problem but the program can continue.
Definition: vx.h:54
Information messages.
Definition: vx.h:56
int line
line number in the source file
Definition: vx.h:86
int ptr
insertion point for message text
Definition: vx.h:87