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.
20 #ifndef EXCEPTIONS_HEADER
21 #define EXCEPTIONS_HEADER
27 class BaseException : public std::exception
30 BaseException(const std::string &s) throw()
34 ~BaseException() throw() {}
35 virtual const char * what() const throw()
43 class AsyncQueuedException : public BaseException {
45 AsyncQueuedException(const std::string &s): BaseException(s) {}
48 class NotImplementedException : public BaseException {
50 NotImplementedException(const std::string &s): BaseException(s) {}
53 class AlreadyExistsException : public BaseException {
55 AlreadyExistsException(const std::string &s): BaseException(s) {}
58 class VersionMismatchException : public BaseException {
60 VersionMismatchException(const std::string &s): BaseException(s) {}
63 class FileNotGoodException : public BaseException {
65 FileNotGoodException(const std::string &s): BaseException(s) {}
68 class SerializationError : public BaseException {
70 SerializationError(const std::string &s): BaseException(s) {}
73 class PacketError : public BaseException {
75 PacketError(const std::string &s): BaseException(s) {}
78 class LoadError : public BaseException {
80 LoadError(const std::string &s): BaseException(s) {}
83 class ContainerFullException : public BaseException {
85 ContainerFullException(const std::string &s): BaseException(s) {}
88 class SettingNotFoundException : public BaseException {
90 SettingNotFoundException(const std::string &s): BaseException(s) {}
93 class InvalidFilenameException : public BaseException {
95 InvalidFilenameException(const std::string &s): BaseException(s) {}
98 class ProcessingLimitException : public BaseException {
100 ProcessingLimitException(const std::string &s): BaseException(s) {}
103 class CommandLineError : public BaseException {
105 CommandLineError(const std::string &s): BaseException(s) {}
108 class ItemNotFoundException : public BaseException {
110 ItemNotFoundException(const std::string &s): BaseException(s) {}
113 class ServerError : public BaseException {
115 ServerError(const std::string &s): BaseException(s) {}
118 class ClientStateError : public BaseException {
120 ClientStateError(std::string s): BaseException(s) {}
123 class PrngException : public BaseException {
125 PrngException(std::string s): BaseException(s) {}
129 Some "old-style" interrupts:
132 class InvalidNoiseParamsException : public BaseException {
134 InvalidNoiseParamsException():
135 BaseException("One or more noise parameters were invalid or require "
139 InvalidNoiseParamsException(const std::string &s):
144 class InvalidPositionException : public BaseException
147 InvalidPositionException():
148 BaseException("Somebody tried to get/set something in a nonexistent position.")
150 InvalidPositionException(const std::string &s):
155 class TargetInexistentException : public std::exception
157 virtual const char * what() const throw()
159 return "Somebody tried to refer to something that doesn't exist.";
163 class NullPointerException : public std::exception
165 virtual const char * what() const throw()
167 return "NullPointerException";