1 /*=========================================================================
4 Module: $RCSfile: bbtkException.h,v $
6 Date: $Date: 2008/01/22 15:02:00 $
7 Version: $Revision: 1.1 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
22 * \brief class Exception:generic class for throwing any exception (header)
28 * \class bbtk::Exception
29 * \brief class Exception : generic class for throwing any exception
34 #ifndef __bbtkException_h__
35 #define __bbtkException_h__
37 #include "bbtkSystem.h"
43 inline std::string bbGetObjectDescription() { return(""); }
45 class BBTK_EXPORT Exception : public std::exception
48 Exception(const std::string& object,
49 const std::string& file,
50 const std::string& message) throw()
55 ~Exception() throw() {}
58 std::cerr << "* ERROR : " << mMessage <<std::endl;
59 int lev = bbtk::MessageManager::GetMessageLevel("Error");
61 std::cerr << "* OBJECT : " <<mObject<<std::endl;
62 std::cerr << "* FILE : " <<mFile<<std::endl;
65 const std::string& GetObject() const { return mObject; }
66 const std::string& GetFile() const { return mFile; }
67 const std::string& GetMessage() const { return mMessage; }