azure-core-amqp
Loading...
Searching...
No Matches
amqp_error.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include "azure/core/amqp/dll_import_export.hpp"
7#include "azure/core/amqp/models/amqp_header.hpp"
8#include "azure/core/amqp/models/amqp_properties.hpp"
9#include "azure/core/amqp/models/amqp_value.hpp"
10
11#include <azure/core/internal/extendable_enumeration.hpp>
12
13namespace Azure { namespace Core { namespace Amqp { namespace Models { namespace _internal {
14
15 class AmqpErrorCondition final
16 : public Azure::Core::_internal::ExtendableEnumeration<AmqpErrorCondition> {
17 public:
18 AmqpErrorCondition() : ExtendableEnumeration(){};
19 explicit AmqpErrorCondition(std::string const& value) : ExtendableEnumeration(value) {}
20
29 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition InternalError;
30
38 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition NotFound;
39
48 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition UnauthorizedAccess;
49
56 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition DecodeError;
57
65 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ResourceLimitExceeded;
66
74 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition NotAllowed;
75
84 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition InvalidField;
85
93 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition NotImplemented;
94
104 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ResourceLocked;
105
114 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition PreconditionFailed;
123 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ResourceDeleted;
124
133 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition IllegalState;
134
148 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition FrameSizeTooSmall;
149
154 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition LinkStolen;
155
159 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition LinkPayloadSizeExceeded;
163 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition LinkDetachForced;
164
169 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ConnectionForced;
170
171 // These are errors that are specific to Azure services.
175 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ServerBusyError;
179 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ArgumentError;
183 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ArgumentOutOfRangeError;
187 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition EntityDisabledError;
191 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition PartitionNotOwnedError;
196 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition StoreLockLostError;
201 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition PublisherRevokedError;
207 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition TimeoutError;
211 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition TrackingIdProperty;
215 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ProtonIo;
220 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ConnectionFramingError;
224 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition OperationCancelled;
230 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition MessageLockLost;
238 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition SessionLockLost;
243 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition SessionCannotBeLocked;
248 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition MessageNotFound;
252 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition SessionNotFound;
257 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition EntityAlreadyExists;
258
277 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition ConnectionRedirect;
278
298 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition LinkRedirect;
299
303 AZ_CORE_AMQP_DLLEXPORT static const AmqpErrorCondition TransferLimitExceeded;
304 };
305
306 struct AmqpError final
307 {
309 AmqpError() = default;
310
312 ~AmqpError() = default;
313
315 AmqpError(AmqpError const&) = default;
316
318 AmqpError& operator=(AmqpError const&) = default;
319
321 AmqpError(AmqpError&&) = default;
322
324 AmqpError& operator=(AmqpError&&) = default;
325
331 AmqpErrorCondition Condition;
332
339 std::string Description;
340
346 AmqpMap Info;
347
353 operator bool() const
354 {
355 return !(Condition.ToString().empty() && Description.empty() && Info.empty());
356 }
357 };
358 std::ostream& operator<<(std::ostream&, AmqpError const&);
359
360}}}}} // namespace Azure::Core::Amqp::Models::_internal