| 1 |
/* |
| 2 |
* This file is part of libcxxsupport. |
| 3 |
* |
| 4 |
* libcxxsupport is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* libcxxsupport is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with libcxxsupport; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 |
*/ |
| 18 |
|
| 19 |
/* |
| 20 |
* libcxxsupport is being developed at the Max-Planck-Institut fuer Astrophysik |
| 21 |
* and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt |
| 22 |
* (DLR). |
| 23 |
*/ |
| 24 |
|
| 25 |
/* |
| 26 |
* Utilities for error reporting |
| 27 |
* |
| 28 |
* Copyright (C) 2003-2011 Max-Planck-Society |
| 29 |
* Author: Martin Reinecke |
| 30 |
*/ |
| 31 |
|
| 32 |
#include "error_handling.h" |
| 33 |
|
| 34 |
using namespace std; |
| 35 |
|
| 36 |
PlanckError::PlanckError(const string &message) : msg (message) {} |
| 37 |
PlanckError::PlanckError(const char *message) : msg (message) {} |
| 38 |
|
| 39 |
//virtual |
| 40 |
PlanckError::~PlanckError() {} |
| 41 |
|
| 42 |
void planck_failure__(const char *file, int line, const char *func, |
| 43 |
const string &msg) |
| 44 |
{ |
| 45 |
cerr << "Error encountered at " << file << ", line " << line << endl; |
| 46 |
if (func) cerr << "(function " << func << ")" << endl; |
| 47 |
if (msg!="") cerr << endl << msg << endl; |
| 48 |
cerr << endl; |
| 49 |
} |
| 50 |
|
| 51 |
void planck_failure__(const char *file, int line, const char *func, |
| 52 |
const char *msg) |
| 53 |
{ planck_failure__ (file,line,func,string(msg)); } |
| 54 |
|
| 55 |
void killjob__() |
| 56 |
{ throw; } |