summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/TLS/TLSError.h')
-rw-r--r--Swiften/TLS/TLSError.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/Swiften/TLS/TLSError.h b/Swiften/TLS/TLSError.h
index f9ed8f7..9e4af2f 100644
--- a/Swiften/TLS/TLSError.h
+++ b/Swiften/TLS/TLSError.h
@@ -1,31 +1,41 @@
/*
- * Copyright (c) 2012 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2012-2019 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Base/Error.h>
namespace Swift {
- class TLSError : public Error {
- public:
- typedef boost::shared_ptr<TLSError> ref;
+ class SWIFTEN_API TLSError : public Error {
+ public:
+ typedef std::shared_ptr<TLSError> ref;
+
+ enum Type {
+ UnknownError,
+ CertificateCardRemoved,
+ AcceptFailed,
+ ConnectFailed
+ };
- enum Type {
- UnknownError,
- CertificateCardRemoved
- };
+ TLSError(Type type = UnknownError, std::string message = "") : type_(type), message_(std::move(message)) {}
- TLSError(Type type = UnknownError) : type(type) {}
+ Type getType() const {
+ return type_;
+ }
- Type getType() const {
- return type;
- }
+ const std::string& getMessage() const {
+ return message_;
+ }
- private:
- Type type;
- };
+ private:
+ Type type_;
+ std::string message_;
+ };
}