Skip to main content

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.

ExceptionWhenNotes
AlreadyConnectedExceptionConnectingThrown when connect() is called on a Client that is already connected.
AMPSExceptionAnytimeBase class for all AMPS exceptions.
AuthenticationExceptionConnectingIndicates an authentication failure occurred on the server.
BadFilterExceptionSubscribe or QueryThis typically indicates a syntax error in a filter expression.
BadRegexTopicExceptionSubscribe or QueryIndicates a malformed regular expression was found in the topic name.
BadSowKeyExceptionSubscribing, Publishing, DeletingRaised when a command uses an invalid SOW key.
CommandExceptionAnytimeBase class for all exceptions relating to commands sent to AMPS.
ConnectionExceptionAnytimeBase class for all exceptions relating to the state of the AMPS connection.
ConnectionRefusedExceptionConnectingThe 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.
DisconnectedExceptionAnytimeNo connection is available when AMPS needed to send data to the server or the user's disconnect handler threw an exception.
DuplicateLogonExceptionConnectingA client tried to logon after already logging on.
InvalidBookmarkExceptionSubscribe or QueryCommand specifies an invalid bookmark.
InvalidOptionsExceptionSubscribe or QueryCommand specifies invalid options.
InvalidOrderByExceptionQueryCommand specifies an invalid orderby clause.
InvalidSubIdExceptionSubscribe or QueryCommand specifies an invalid subid.
InvalidTopicExceptionSubscribe or QueryThe 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.
InvalidURIExceptionConnectingThe URI string provided to connect() was formatted improperly.
LogonRequiredExceptionAnytimeA client attempted to execute a command before calling logon.
MessageStreamFullExceptionInternal client useIndicates that a MessageStream has reached its max depth and can't enqueue another message.
MissingFieldsExceptionSubscribe or QueryThrown when a command is missing required fields.
NameInUseExceptionConnectingThe client name (specified when instantiating Client) is already in use on the server.
NotEntitledExceptionConnecting, Subscribe or QueryAn authenticated client attempted to access a resource to which the user has not been granted proper entitlements.
PublishExceptionPublishingA client attempted to publish an invalid message or some other error occurs with the message. Requested operation.
PublishStoreGapExceptionConnectingThe client attempted to logon to a server that appears to be missing messages from this client that are no longer in the publish store.
ReconnectMaximumExceededExceptionConnectingThe maximum allowed time for attempting to connect to the server has been exceeded.
RetryOperationExceptionAnytimeAn error occurred that caused processing of the last command to be aborted. Try issuing the command again.
StoreExceptionPublishing, SubscribingThrown 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.
SubidInUseExceptionSubscribingIndicates a subscription has been placed with the same subscription ID.
SubscriptionAlreadyExistsExceptionSubscribingA subscription has been requested using the same CommandId as another subscription. Create a unique CommandId for every subscription.
TimedOutExceptionAnytimeA timeout occurred waiting for a response to a command.
TransportTypeExceptionConnectingThrown when a transport type was selected in the URI that is unknown to AMPS.
UnknownExceptionAnytimeThrown when an internal error occurs. Contact AMPS support immediately.
UsageExceptionChanging 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.