MCPcopy Create free account
hub / github.com/coin-or/CppAD / Default

Method Default

include/cppad/utility/error_handler.hpp:182–208  ·  view source on GitHub ↗

The default error handler

Source from the content-addressed store, hash-verified

180
181 // The default error handler
182 static void Default(
183 bool known,
184 int line ,
185 const char *file ,
186 const char *exp ,
187 const char *msg )
188 { using std::cerr;
189 using std::endl;
190
191 cerr << CPPAD_PACKAGE_STRING;
192 if( known )
193 cerr << " error from a known source:" << endl;
194 else
195 cerr << " error from unknown source" << endl;
196 if( msg[0] != '\0' )
197 cerr << msg << endl;
198 cerr << "Error detected by false result for" << endl;
199 cerr << " " << exp << endl;
200 cerr << "at line " << line << " in the file " << endl;
201 cerr << " " << file << endl;
202
203 // terminate program execution
204 assert(false);
205
206 // termination when NDEBUG is defined
207 std::exit(1);
208 }
209
210 // current error handler
211 static Handler &Current(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected