error_handling.cc

00001 /*
00002  *  This file is part of libcxxsupport.
00003  *
00004  *  libcxxsupport is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  libcxxsupport is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with libcxxsupport; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 /*
00020  *  libcxxsupport is being developed at the Max-Planck-Institut fuer Astrophysik
00021  *  and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
00022  *  (DLR).
00023  */
00024 
00025 /*
00026  *  Utilities for error reporting
00027  *
00028  *  Copyright (C) 2003-2011 Max-Planck-Society
00029  *  Author: Martin Reinecke
00030  */
00031 
00032 #include "error_handling.h"
00033 
00034 using namespace std;
00035 
00036 PlanckError::PlanckError(const string &message) : msg (message) {}
00037 PlanckError::PlanckError(const char *message) : msg (message) {}
00038 
00039 //virtual
00040 PlanckError::~PlanckError() {}
00041 
00042 void planck_failure__(const char *file, int line, const char *func,
00043   const string &msg)
00044   {
00045   cerr << "Error encountered at " << file << ", line " << line << endl;
00046   if (func) cerr << "(function " << func << ")" << endl;
00047   if (msg!="") cerr << endl << msg << endl;
00048   cerr << endl;
00049   }
00050 
00051 void planck_failure__(const char *file, int line, const char *func,
00052   const char *msg)
00053   { planck_failure__ (file,line,func,string(msg)); }
00054 
00055 void killjob__()
00056   { throw; }

Generated on Thu Oct 8 14:48:51 2015 for LevelS C++ support library