summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/WAException.h
diff options
context:
space:
mode:
authorFishbone <fishbone@miranda-ng.org>2013-06-02 16:19:21 +0000
committerFishbone <fishbone@miranda-ng.org>2013-06-02 16:19:21 +0000
commitab7e0b08fa8c31cf1d468ab4b3c660e2b1836811 (patch)
tree52977603ea0f431adff16573d3d5b46a95843c7f /protocols/WhatsApp/src/WhatsAPI++/WAException.h
parent8320783f99419db1e40346fdb292c19ee008948b (diff)
Added WhatsApp-protocol
git-svn-id: http://svn.miranda-ng.org/main/trunk@4861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAException.h')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WAException.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAException.h b/protocols/WhatsApp/src/WhatsAPI++/WAException.h
new file mode 100644
index 0000000000..47d5cdfaf7
--- /dev/null
+++ b/protocols/WhatsApp/src/WhatsAPI++/WAException.h
@@ -0,0 +1,40 @@
+/*
+ * WAException.h
+ *
+ * Created on: 27/06/2012
+ * Author: Antonio
+ */
+
+
+
+#ifndef WAEXCEPTION_H_
+#define WAEXCEPTION_H_
+
+#include <stdexcept>
+#include <string>
+
+class WAException: public std::runtime_error {
+public:
+ int type;
+ int subtype;
+ time_t expire_date; // in seconds
+
+ static const int LOGIN_FAILURE_EX = 1;
+ static const int LOGIN_FAILURE_EX_TYPE_PASSWORD = 0;
+ static const int LOGIN_FAILURE_EX_TYPE_EXPIRED = 1;
+
+ static const int CORRUPT_STREAM_EX = 2;
+
+ static const int SOCKET_EX = 3;
+ static const int SOCKET_EX_RESOLVE_HOST = 0;
+ static const int SOCKET_EX_OPEN = 1;
+ static const int SOCKET_EX_INIT = 2;
+ static const int SOCKET_EX_SEND = 3;
+ static const int SOCKET_EX_RECV = 4;
+
+ WAException(const std::string& err): runtime_error(err) {this->type = 0; this->subtype = 0; this->expire_date = 0;};
+ WAException(const std::string& err, int type, int subtype): runtime_error(err), type(type), subtype(subtype), expire_date(0) {};
+ WAException(const std::string& err, int type, int subtype, time_t expireDate): runtime_error(err), type(type), subtype(subtype), expire_date(expireDate) {};
+};
+
+#endif /* WAEXCEPTION_H_ */