comparison engine/core/util/base/exception.cpp @ 684:4f36c890b1dd

* Merged the 0.3.3dev branche changes to the trunk.
author helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 06 Dec 2010 19:25:27 +0000
parents 90005975cdbb
children
comparison
equal deleted inserted replaced
683:4fe9747d5f88 684:4f36c890b1dd
1 /*************************************************************************** 1 /***************************************************************************
2 * Copyright (C) 2005-2008 by the FIFE team * 2 * Copyright (C) 2005-2010 by the FIFE team *
3 * http://www.fifengine.de * 3 * http://www.fifengine.net *
4 * This file is part of FIFE. * 4 * This file is part of FIFE. *
5 * * 5 * *
6 * FIFE is free software; you can redistribute it and/or * 6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public * 7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either * 8 * License as published by the Free Software Foundation; either *
32 32
33 33
34 namespace FIFE { 34 namespace FIFE {
35 static Logger _log(LM_EXCEPTION); 35 static Logger _log(LM_EXCEPTION);
36 36
37 Exception::Exception(const std::string& msg): m_message(msg) { 37 Exception::Exception(const std::string& msg): std::runtime_error(msg) {
38 FL_WARN(_log, LMsg() << getMessage()); 38 FL_PANIC(_log, LMsg() << what());
39 } 39 }
40 40
41 Exception::~Exception() {} 41 Exception::~Exception() throw() {}
42 42
43 std::string Exception::getMessage() const { 43 const char* Exception::what() const throw() {
44 std::stringstream str; 44 std::stringstream str;
45 str << "_[" << getTypeStr() << "]_ , " << m_message; 45
46 return str.str(); 46 str << "_[" << getTypeStr() << "]_ , " << std::runtime_error::what();
47 return str.str().c_str();
47 } 48 }
48 }//FIFE 49 }//FIFE