summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Client/ClientError.h10
-rw-r--r--Swiften/Client/ClientSession.h3
-rw-r--r--Swiften/Client/CoreClient.cpp1
3 files changed, 12 insertions, 2 deletions
diff --git a/Swiften/Client/ClientError.h b/Swiften/Client/ClientError.h
index 5277a0e..19de42b 100644
--- a/Swiften/Client/ClientError.h
+++ b/Swiften/Client/ClientError.h
@@ -1,11 +1,14 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <boost/shared_ptr.hpp>
+#include <boost/system/system_error.hpp>
+
namespace Swift {
class ClientError {
public:
@@ -51,7 +54,12 @@ namespace Swift {
Type getType() const { return type_; }
+ void setErrorCode(boost::shared_ptr<boost::system::error_code> errorCode) { errorCode_ = errorCode; }
+
+ boost::shared_ptr<boost::system::error_code> getErrorCode() const { return errorCode_; }
+
private:
Type type_;
+ boost::shared_ptr<boost::system::error_code> errorCode_;
};
}
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h
index 61de014..9bbc3f2 100644
--- a/Swiften/Client/ClientSession.h
+++ b/Swiften/Client/ClientSession.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -57,6 +57,7 @@ namespace Swift {
TLSError,
StreamError
} type;
+ boost::shared_ptr<boost::system::error_code> errorCode;
Error(Type type) : type(type) {}
};
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index c91e5c5..baebd4a 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -259,6 +259,7 @@ void CoreClient::handleSessionFinished(boost::shared_ptr<Error> error) {
clientError = ClientError(ClientError::StreamError);
break;
}
+ clientError.setErrorCode(actualError->errorCode);
}
else if (boost::shared_ptr<TLSError> actualError = boost::dynamic_pointer_cast<TLSError>(error)) {
switch(actualError->getType()) {