1 |
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: t; -*- vim:ts=4:sw=4 |
2 |
|
// |
3 |
|
// Copyright (C) 2004 David Lau (skunix) |
4 |
|
// Chong Kai Xiong (descender) |
5 |
|
// |
6 |
|
// This file is part of The Plains of Usata. |
7 |
|
// |
8 |
|
// The Plains of Usata is licensed under the GNU General Public |
9 |
|
// License (GPL) version 2. For details, please see the COPYING file |
10 |
|
// included in the software distribution, or visit |
11 |
|
// http://www.fsf.org/licenses/gpl.html. |
12 |
|
// |
13 |
|
// $Id$ |
14 |
|
|
15 |
#ifndef USATA_EXCEPTION_TYPES_HPP |
#ifndef USATA_EXCEPTION_TYPES_HPP |
16 |
#define USATA_EXCEPTION_TYPES_HPP |
#define USATA_EXCEPTION_TYPES_HPP |
17 |
|
|
18 |
#include <exception> |
#include <exception> |
19 |
#include <string> |
#include <string> |
20 |
|
|
21 |
namespace usata |
namespace usata |
22 |
{ |
{ |
23 |
class RecoverableError : public std::runtime_error |
class RecoverableError : public std::runtime_error |
24 |
{ |
{ |
25 |
public: |
public: |
26 |
RecoverableError(const std::string& w=""):std::runtime_error(w) |
RecoverableError(const std::string& w=""):std::runtime_error(w) |
27 |
{} |
{} |
28 |
virtual ~RecoverableError()throw(){} |
virtual ~RecoverableError()throw(){} |
|
|
|
29 |
}; |
}; |
30 |
|
|
31 |
class FatalError : public std::exception |
class FatalError : public std::exception |
32 |
{ |
{ |
33 |
std::string what_; |
std::string what_; |
34 |
public: |
public: |
35 |
FatalError(const std::string&w):what_(w){}; |
FatalError(const std::string&w):what_(w){}; |
36 |
virtual const char*what()const throw()=0; |
virtual const char*what()const throw()=0; |
37 |
virtual ~FatalError()throw(){} |
virtual ~FatalError()throw(){} |
38 |
}; |
}; |
39 |
|
|
40 |
} |
} |
41 |
|
|
42 |
#endif |
#endif |