diff options
Diffstat (limited to 'Swiften/Base/LogSerializers.cpp')
-rw-r--r-- | Swiften/Base/LogSerializers.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/Swiften/Base/LogSerializers.cpp b/Swiften/Base/LogSerializers.cpp index 5ac1e15..3f8e9ce 100644 --- a/Swiften/Base/LogSerializers.cpp +++ b/Swiften/Base/LogSerializers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Isode Limited. + * Copyright (c) 2016-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,6 +7,7 @@ #include <Swiften/Base/LogSerializers.h> #include <Swiften/Elements/Presence.h> +#include <Swiften/Network/BOSHConnection.h> namespace Swift { @@ -65,6 +66,57 @@ std::ostream& operator<<(std::ostream& stream, const Presence& presence) { return stream; } +std::ostream& operator<<(std::ostream& stream, const BOSHError& boshError) { + std::string errorString; + switch (boshError.getType()) { + case BOSHError::BadRequest: + errorString = "BadRequest"; + break; + case BOSHError::HostGone: + errorString = "HostGone"; + break; + case BOSHError::HostUnknown: + errorString = "HostUnknown"; + break; + case BOSHError::ImproperAddressing: + errorString = "ImproperAddressing"; + break; + case BOSHError::InternalServerError: + errorString = "InternalServerError"; + break; + case BOSHError::ItemNotFound: + errorString = "ItemNotFound"; + break; + case BOSHError::OtherRequest: + errorString = "OtherRequest"; + break; + case BOSHError::PolicyViolation: + errorString = "PolicyViolation"; + break; + case BOSHError::RemoteConnectionFailed: + errorString = "RemoteConnectionFailed"; + break; + case BOSHError::RemoteStreamError: + errorString = "RemoteStreamError"; + break; + case BOSHError::SeeOtherURI: + errorString = "SeeOtherURI"; + break; + case BOSHError::SystemShutdown: + errorString = "SystemShutdown"; + break; + case BOSHError::UndefinedCondition: + errorString = "UndefinedCondition"; + break; + case BOSHError::NoError: + errorString = "NoError"; + break; + } + + stream << "BOSHError( " << errorString << " )"; + return stream; +} + }; ::std::ostream& operator<<(::std::ostream& os, const boost::optional<std::string>& optStr) { |