]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/exceptions.h
Rework escape/pause menu (#5719)
[dragonfireclient.git] / src / exceptions.h
index 6d6ad333a442bcb5690fbce59e1edf2a9bb25ec2..1b39c6725a7921a86f2cba8ccfc5b5707f864037 100644 (file)
@@ -27,10 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class BaseException : public std::exception
 {
 public:
-       BaseException(const std::string &s) throw()
-       {
-               m_s = s;
-       }
+       BaseException(const std::string &s) throw(): m_s(s) {}
        ~BaseException() throw() {}
        virtual const char * what() const throw()
        {
@@ -65,11 +62,21 @@ class FileNotGoodException : public BaseException {
        FileNotGoodException(const std::string &s): BaseException(s) {}
 };
 
+class DatabaseException : public BaseException {
+public:
+       DatabaseException(const std::string &s): BaseException(s) {}
+};
+
 class SerializationError : public BaseException {
 public:
        SerializationError(const std::string &s): BaseException(s) {}
 };
 
+class PacketError : public BaseException {
+public:
+       PacketError(const std::string &s): BaseException(s) {}
+};
+
 class LoadError : public BaseException {
 public:
        LoadError(const std::string &s): BaseException(s) {}
@@ -110,21 +117,38 @@ class ServerError : public BaseException {
        ServerError(const std::string &s): BaseException(s) {}
 };
 
-// Only used on Windows (SEH)
-class FatalSystemException : public BaseException {
+class ClientStateError : public BaseException {
 public:
-       FatalSystemException(const std::string &s): BaseException(s) {}
+       ClientStateError(const std::string &s): BaseException(s) {}
 };
 
-class ClientStateError : public BaseException {
+class PrngException : public BaseException {
 public:
-       ClientStateError(std::string s): BaseException(s) {}
+       PrngException(const std::string &s): BaseException(s) {}
 };
 
+class ModError : public BaseException {
+public:
+       ModError(const std::string &s): BaseException(s) {}
+};
+
+
 /*
        Some "old-style" interrupts:
 */
 
+class InvalidNoiseParamsException : public BaseException {
+public:
+       InvalidNoiseParamsException():
+               BaseException("One or more noise parameters were invalid or require "
+                       "too much memory")
+       {}
+
+       InvalidNoiseParamsException(const std::string &s):
+               BaseException(s)
+       {}
+};
+
 class InvalidPositionException : public BaseException
 {
 public: