AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.6

Public Member Functions | Static Public Member Functions | List of all members
AMPS::AMPSException Class Reference

Base class for all exceptions in AMPS. More...

`#include <AMPSException.hpp>`

Inheritance diagram for AMPS::AMPSException:

## Public Member Functions
| AMPSException (const std::string &message_, amps_result result_)
| Construct an AMPSException from a text message. More...
| AMPSException (amps_handle client_, amps_result result_)
| Construct an AMPSException from the last error message on client. More...
const char * | toString () const
| Returns a null-terminated string containing self's error message.
virtual const char * | getClassName () const
| Returns the actual name of the subclass thrown – useful when RTTI is disabled, but you'd still like to log the exact exception type.

## Static Public Member Functions
template<class T >
static void | throwFor (const T &context_, amps_result result_)
| Constructs and throws the appropriate exception corresponding to a given result. More...

## Detailed Description

Base class for all exceptions in AMPS.

May be constructed with text, or with a client handle, in which case the exception text is made equal to the last error message on that client.

## Constructor & Destructor Documentation

## ◆ AMPSException() [1/2]

AMPS::AMPSException::AMPSException | ( | const std::string & | message_,
|  | amps_result | result_
| ) |  |
| inline

Construct an AMPSException from a text message.

Parameters

  message_ | The text of the error message.
  result_ | The last amps_result you were given.

## ◆ AMPSException() [2/2]

AMPS::AMPSException::AMPSException | ( | amps_handle | client_,
|  | amps_result | result_
| ) |  |
| inline

Construct an AMPSException from the last error message on client.

Parameters

  client_ | The client to retrieve an error message from.
  result_ | The result code you last retrieved from this client.

## Member Function Documentation

## ◆ throwFor()

template<class T >

static void AMPS::AMPSException::throwFor | ( | const T & | context_,
|  | amps_result | result_
| ) |  |
| static

Constructs and throws the appropriate exception corresponding to a given result.

Parameters

  context_ | The object to pass to the exception's constructor.
  result_ | the result that should be used to determine the exception type.

The documentation for this class was generated from the following file:

- include/amps/AMPSException.hpp