3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 class BaseException : public std::exception
28 BaseException(const std::string &s) throw() : m_s(s) {}
29 ~BaseException() throw() = default;
31 virtual const char *what() const throw() { return m_s.c_str(); }
37 class AlreadyExistsException : public BaseException
40 AlreadyExistsException(const std::string &s) : BaseException(s) {}
43 class VersionMismatchException : public BaseException
46 VersionMismatchException(const std::string &s) : BaseException(s) {}
49 class FileNotGoodException : public BaseException
52 FileNotGoodException(const std::string &s) : BaseException(s) {}
55 class DatabaseException : public BaseException
58 DatabaseException(const std::string &s) : BaseException(s) {}
61 class SerializationError : public BaseException
64 SerializationError(const std::string &s) : BaseException(s) {}
67 class PacketError : public BaseException
70 PacketError(const std::string &s) : BaseException(s) {}
73 class SettingNotFoundException : public BaseException
76 SettingNotFoundException(const std::string &s) : BaseException(s) {}
79 class InvalidFilenameException : public BaseException
82 InvalidFilenameException(const std::string &s) : BaseException(s) {}
85 class ItemNotFoundException : public BaseException
88 ItemNotFoundException(const std::string &s) : BaseException(s) {}
91 class ServerError : public BaseException
94 ServerError(const std::string &s) : BaseException(s) {}
97 class ClientStateError : public BaseException
100 ClientStateError(const std::string &s) : BaseException(s) {}
103 class PrngException : public BaseException
106 PrngException(const std::string &s) : BaseException(s) {}
109 class ModError : public BaseException
112 ModError(const std::string &s) : BaseException(s) {}
116 Some "old-style" interrupts:
119 class InvalidNoiseParamsException : public BaseException
122 InvalidNoiseParamsException() :
123 BaseException("One or more noise parameters were invalid or "
129 InvalidNoiseParamsException(const std::string &s) : BaseException(s) {}
132 class InvalidPositionException : public BaseException
135 InvalidPositionException() :
136 BaseException("Somebody tried to get/set something in a "
137 "nonexistent position.")
140 InvalidPositionException(const std::string &s) : BaseException(s) {}