CppWAMP
C++11 client library for the WAMP protocol
|
Go to the documentation of this file.
7 #ifndef CPPWAMP_ERROR_HPP
8 #define CPPWAMP_ERROR_HPP
18 #include <system_error>
26 #define CPPWAMP_LOGIC_ERROR(msg) \
27 error::Logic::raise(__FILE__, __LINE__, (msg));
36 #define CPPWAMP_LOGIC_CHECK(cond, msg) \
37 {error::Logic::check((cond), __FILE__, __LINE__, (msg));}
52 class CPPWAMP_API
Failure :
public std::system_error
56 static std::string makeMessage(std::error_code ec);
60 static std::string makeMessage(std::error_code ec,
const std::string& info);
63 explicit Failure(std::error_code ec);
66 Failure(std::error_code ec,
const std::string& info);
73 struct CPPWAMP_API
Logic :
public std::logic_error
75 using std::logic_error::logic_error;
78 static void raise(
const char* file,
int line,
const std::string& msg);
82 static void check(
bool condition,
const char* file,
int line,
83 const std::string& msg);
89 struct CPPWAMP_API
BadType :
public std::runtime_error
91 explicit BadType(
const std::string& what);
99 explicit Access(
const std::string& what);
100 Access(
const std::string& from,
const std::string& to);
115 struct CPPWAMP_API
Decode:
public std::runtime_error
117 explicit Decode(
const std::string& what);
187 virtual const char* name()
const noexcept
override;
190 virtual std::string message(
int ev)
const override;
193 virtual bool equivalent(
const std::error_code& code,
194 int condition)
const noexcept
override;
212 CPPWAMP_API std::error_code make_error_code(
SessionErrc errc);
218 CPPWAMP_API std::error_condition make_error_condition(
SessionErrc errc);
260 virtual const char* name()
const noexcept
override;
263 virtual std::string message(
int ev)
const override;
266 virtual bool equivalent(
const std::error_code& code,
267 int condition)
const noexcept
override;
286 CPPWAMP_API std::error_code make_error_code(
DecodingErrc errc);
292 CPPWAMP_API std::error_condition make_error_condition(
DecodingErrc errc);
326 virtual const char* name()
const noexcept
override;
329 virtual std::string message(
int ev)
const override;
332 virtual bool equivalent(
const std::error_code& code,
333 int condition)
const noexcept
override;
351 CPPWAMP_API std::error_code make_error_code(
ProtocolErrc errc);
357 CPPWAMP_API std::error_condition make_error_condition(
ProtocolErrc errc);
384 virtual const char* name()
const noexcept
override;
387 virtual std::string message(
int ev)
const override;
390 virtual bool equivalent(
const std::error_code& code,
391 int condition)
const noexcept
override;
410 CPPWAMP_API std::error_code make_error_code(
TransportErrc errc);
416 CPPWAMP_API std::error_condition make_error_condition(
TransportErrc errc);
448 virtual const char* name()
const noexcept
override;
451 virtual std::string message(
int ev)
const override;
454 virtual bool equivalent(
const std::error_code& code,
455 int condition)
const noexcept
override;
474 CPPWAMP_API std::error_code make_error_code(
RawsockErrc errc);
480 CPPWAMP_API std::error_condition make_error_condition(
RawsockErrc errc);
486 #if !defined CPPWAMP_FOR_DOXYGEN
516 #endif // !defined CPPWAMP_FOR_DOXYGEN
519 #ifndef CPPWAMP_COMPILED_LIB
520 #include "internal/error.ipp"
523 #endif // CPPWAMP_ERROR_HPP
@ authorizationFailed
The authorization operation failed.
Base class for exceptions involving invalid Variant types.
Definition: error.hpp:89
@ failed
Operation failed.
@ unexpectedMsg
Received unexpected WAMP message.
std::error_category used for reporting errors specific to raw socket transports.
Definition: error.hpp:444
@ badRxLength
Incoming message exceeds maximum length.
DecodingErrc
Error code values used with the DecodingCategory error category.
Definition: error.hpp:241
std::error_category used for reporting deserialization errors.
Definition: error.hpp:256
bool lookupWampErrorUri(const std::string &uri, SessionErrc fallback, SessionErrc &result)
Definition: error.ipp:238
@ optionNotAllowed
Option is disallowed by the router.
std::error_category used for reporting errors at the WAMP session layer.
Definition: error.hpp:183
@ noSuchProcedure
No procedure was registered under the given URI.
@ networkFailure
Router encountered a network failure.
@ registerError
Register error reported by dealer.
@ procedureAlreadyExists
A procedure with the given URI is already registered.
@ success
Operation succesful.
@ badTxLength
Outgoing message exceeds maximum length.
@ success
Operation succesful.
std::error_category used for reporting errors at the transport layer.
Definition: error.hpp:380
@ unsupportedMsg
Received unsupported WAMP message.
Defines macros related to exporting/importing APIs.
@ badBase64Char
Invalid Base64 character.
ProtocolErrc
Error code values used with the ProtocolCategory error category.
Definition: error.hpp:308
@ badBase64Length
Invalid Base64 string length.
@ cancelled
A previously issued call was cancelled.
@ failure
Decoding failed.
General purpose runtime exception that wraps a std::error_code.
Definition: error.hpp:52
@ joinError
Join error reported by router.
@ success
Operation successful.
@ callError
Call error reported by callee or dealer.
@ badBase64Padding
Invalid Base64 padding.
@ discloseMeDisallowed
Router rejected client request to disclose its identity.
@ notAuthorized
This peer is not authorized to perform the operation.
@ allTransportsFailed
All transports failed during connection.
@ noSuchRegistration
Could not unregister; the given registration is not active.
@ reservedBitsUsed
Use of reserved bits (unsupported feature)
@ goodbyeAndOut
Session ended successfully.
@ badSchema
Invalid WAMP message schema.
@ sessionEndedByPeer
Session ended by other peer.
Definition: anyhandler.hpp:36
@ success
Operation successful.
RawsockErrc
Error code values used with the RawsockCategory error category.
Definition: error.hpp:426
@ badHandshake
Invalid handshake format from peer.
@ invalidArgument
The given argument types/values are not acceptable to the called procedure.
@ publishError
Publish error reported by broker.
@ success
Operation successful.
@ invalidUri
An invalid WAMP URI was provided.
@ sessionEnded
Operation aborted; session ended by this peer.
@ closeRealm
The other peer is leaving the realm.
@ invalidState
Invalid state for this operation.
@ badSerializer
Serializer unsupported.
@ unsubscribeError
Unsubscribe error reported by broker.
Exception type thrown when codec deserialization fails.
Definition: error.hpp:115
@ badMessageType
Invalid message type.
@ noSuchRealm
Attempt to join non-existent realm.
@ emptyInput
Input is empty or has no tokens.
@ aborted
Operation aborted.
@ noSuchSubscription
Could not unsubscribe; the given subscription is not active.
Exception thrown when a pre-condition is not met.
Definition: error.hpp:73
@ noSuchRole
Attempt to authenticate under unsupported role.
@ systemShutdown
The other peer is shutting down.
Exception type thrown when converting a Variant to an invalid type.
Definition: error.hpp:106
@ badMaxLength
Maximum message length unacceptable.
@ expectedStringKey
Expected a string key.
@ subscribeError
Subscribe error reported by broker.
@ badDecode
Error decoding WAMP message payload.
@ maxConnectionsReached
Maximum connection count reached.
SessionErrc
Error code values used with the SessionCategory error category.
Definition: error.hpp:142
std::error_category used for reporting protocol errors related to invalid WAMP messages.
Definition: error.hpp:322
TransportErrc
Error code values used with the TransportCategory error category.
Definition: error.hpp:367
Exception type thrown when accessing a Variant as an invalid type.
Definition: error.hpp:97
@ noEligibleCallee
Call options lead to the exclusion of all callees providing the procedure.
@ unregisterError
Unregister error reported by dealer.