The default error handler
| 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) |
nothing calls this directly
no outgoing calls
no test coverage detected