Exception Types
Each method in AMPS documents the kinds of exceptions that it can throw. The following table details each of the exception types thrown by AMPS. They are all declared in the AMPS
namespace, and all of these types publicly inherit from class std::runtime_error
.
Exception | When | Notes |
---|---|---|
AlreadyConnectedException | Connecting | Thrown when connect() is called on a Client that is already connected. |
AMPSException | Anytime | Base class for all AMPS exceptions. |
AuthenticationException | Connecting | Indicates an authentication failure occurred on the server. |
BadFilterException | Subscribe or Query | This typically indicates a syntax error in a filter expression. |
BadRegexTopicException | Subscribe or Query | Indicates a malformed regular expression was found in the topic name. |
BadSowKeyException | Subscribing, Publishing, Deleting | Raised when a command uses an invalid SOW key. |
CommandException | Anytime | Base class for all exceptions relating to commands sent to AMPS. |
ConnectionException | Anytime | Base class for all exceptions relating to the state of the AMPS connection. |
ConnectionRefusedException | Connecting | The connection was actively refused by the server. Validate that the server is running, that network connectivity is available, and the settings on the client match those on the server. |
DisconnectedException | Anytime | No connection is available when AMPS needed to send data to the server or the user's disconnect handler threw an exception. |
DuplicateLogonException | Connecting | A client tried to logon after already logging on. |
InvalidBookmarkException | Subscribe or Query | Command specifies an invalid bookmark. |
InvalidOptionsException | Subscribe or Query | Command specifies invalid options. |
InvalidOrderByException | Query | Command specifies an invalid orderby clause. |
InvalidSubIdException | Subscribe or Query | Command specifies an invalid subid . |
InvalidTopicException | Subscribe or Query | The topic is not configured for the requested operation. For example, a sow command was issued for a topic that is not in the SOW or a bookmark subscribe was issued for a topic that is not recorded in the transaction log. |
InvalidURIException | Connecting | The URI string provided to connect() was formatted improperly. |
LogonRequiredException | Anytime | A client attempted to execute a command before calling logon. |
MessageStreamFullException | Internal client use | Indicates that a MessageStream has reached its max depth and can't enqueue another message. |
MissingFieldsException | Subscribe or Query | Thrown when a command is missing required fields. |
NameInUseException | Connecting | The client name (specified when instantiating Client ) is already in use on the server. |
NotEntitledException | Connecting, Subscribe or Query | An authenticated client attempted to access a resource to which the user has not been granted proper entitlements. |
PublishException | Publishing | A client attempted to publish an invalid message or some other error occurs with the message. Requested operation. |
PublishStoreGapException | Connecting | The client attempted to logon to a server that appears to be missing messages from this client that are no longer in the publish store. |
ReconnectMaximumExceededException | Connecting | The maximum allowed time for attempting to connect to the server has been exceeded. |
RetryOperationException | Anytime | An error occurred that caused processing of the last command to be aborted. Try issuing the command again. |
StoreException | Publishing, Subscribing | Thrown when a publish store or bookmark store experiences some internal error (such as lack of resources or permissions), or is in an improper state for the requested operation. |
SubidInUseException | Subscribing | Indicates a subscription has been placed with the same subscription ID. |
SubscriptionAlreadyExistsException | Subscribing | A subscription has been requested using the same CommandId as another subscription. Create a unique CommandId for every subscription. |
TimedOutException | Anytime | A timeout occurred waiting for a response to a command. |
TransportTypeException | Connecting | Thrown when a transport type was selected in the URI that is unknown to AMPS. |
UnknownException | Anytime | Thrown when an internal error occurs. Contact AMPS support immediately. |
UsageException | Changing the properties of an object. | Thrown when the object is not in a valid state for setting the properties. For example, some properties of a Client (such as the BookmarkStore used) cannot be changed while that client is connected to AMPS. |