All HAMcast exceptions inherit std::exception. More...
Classes | |
class | hamcast::connection_to_middleware_failed |
Thrown to indicate that the client was unable to connect to a running HAMcast middleware. More... | |
class | hamcast::connection_to_middleware_lost |
Thrown to indicate that the client lost the connection to the middleware. More... | |
class | hamcast::internal_interface_error |
Thrown to indicate that an IPC call failed because of an internal interface error. More... | |
class | hamcast::requirement_failed |
Thrown by HC_REQUIRE(req) and HC_REQUIRE_VERBOSE(req,verbose_msg) if the requirement req evaluates to false. More... | |
Defines | |
#define | HC_REQUIRE(req) |
#define | HC_REQUIRE_VERBOSE(req, verbose_msg) |
Enumerations | |
enum | hamcast::connection_error { hamcast::no_config_file_found, hamcast::no_running_middleware_found, hamcast::socket_creation_failed, hamcast::incompatible_middleware_found } |
All HAMcast exceptions inherit std::exception.
connection_to_middleware_failed and connection_to_middleware_lost are thrown by libhamcast if communication to the middleware couldn't be established or is interrupted. A libhamcast based application terminates if one of those exception was thrown.
internal_interface_error is thrown if an unexpected exception occurs in a middleware module. This exception is forwarded to the client on IPC calls.
requirement_failed is thrown if you call member functions of an opject that's in an invalid state or if you pass invalid parameters to a function.
#define HC_REQUIRE | ( | req | ) |
if (!(req)) \ { \ HC_LOG_FATAL("Requirement failed: " << BOOST_STRINGIZE(req)); \ throw ::hamcast:: \ requirement_failed( __LINE__ , __FILE__ , BOOST_STRINGIZE(req) ); \ }
Similiar to assert() but throws an exception if the requirement fails instead of calling terminate() and also logs the error with HC_LOG_FATAL().
req | The requirement (source code). |
hamcast::requirement_failed |
#define HC_REQUIRE_VERBOSE | ( | req, | ||
verbose_msg | ||||
) |
if (!(req)) \ { \ HC_LOG_FATAL("Requirement failed: " << BOOST_STRINGIZE(req)); \ std::ostringstream err; \ err << verbose_msg ; \ throw ::hamcast:: \ requirement_failed( __LINE__ , __FILE__ , err.str() ); \ }
Equal to HC_REQUIRE(req) but uses verbose_msg
as as error message instead of req
.
req | The requirement (source code). | |
verbose_msg | An expression that could use shift operations and results in an string. |
hamcast::requirement_failed |
Describes all possible errors that can occur if you try to establish a connection to the middleware.