summaryrefslogtreecommitdiffstats
path: root/src/Net
diff options
context:
space:
mode:
Diffstat (limited to 'src/Net')
-rw-r--r--src/Net/Exception.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Net/Exception.h b/src/Net/Exception.h
index 8522528..1ddf5f4 100644
--- a/src/Net/Exception.h
+++ b/src/Net/Exception.h
@@ -42,9 +42,9 @@ class Exception {
long subSubCode;
public:
- Exception(const std::string &where0, ErrorCode errorCode0, long subCode0 = 0, long subSubCode0 = 0)
+ Exception(const std::string &where0, ErrorCode errorCode0 = SUCCESS, long subCode0 = 0, long subSubCode0 = 0)
: where(where0), errorCode(errorCode0), subCode(subCode0), subSubCode(subSubCode0) {}
- Exception(ErrorCode errorCode0, long subCode0 = 0, long subSubCode0 = 0) : errorCode(errorCode0), subCode(subCode0), subSubCode(subSubCode0) {}
+ Exception(ErrorCode errorCode0 = SUCCESS, long subCode0 = 0, long subSubCode0 = 0) : errorCode(errorCode0), subCode(subCode0), subSubCode(subSubCode0) {}
virtual ~Exception() {}
const std::string& getWhere() const {return where;}
@@ -53,6 +53,10 @@ class Exception {
long getSubSubCode() const {return subSubCode;}
std::string strerror() const;
+
+ operator bool() const {
+ return (errorCode != SUCCESS);
+ }
};
}