coral
A C++ library for distributed co-simulation
Classes | Enumerations | Functions
coral::error Namespace Reference

Exception types and error handling facilities. More...

Classes

class  PreconditionViolation
 An exception which is used to signal that one or more of a function's preconditions were not met. More...
 
class  ProtocolNotSupported
 Exception thrown on an attempt to use an unsupported protocol. More...
 
class  ProtocolViolationException
 Exception thrown when communication fails due to a protocol violation. More...
 

Enumerations

Functions

std::string ErrnoMessage (const std::string &msg, int errnoValue) CORAL_NOEXCEPT
 Constructs an error message by combining a user-defined message and a standard system error message. More...
 
const std::error_categorygeneric_category () CORAL_NOEXCEPT
 Error category for generic errors.
 
const std::error_categorysim_category () CORAL_NOEXCEPT
 Error category for simulation errors.
 

Detailed Description

Exception types and error handling facilities.

Enumeration Type Documentation

Generic errors.

These are for conditions that are not covered by std::errc, but which are not specific to simulation as such.

Enumerator
aborted 

An ongoing operation was aborted.

canceled 

A pending operation was canceled before it was started.

operation_failed 

An ongoing operation failed.

fatal 

An irrecoverable error happened.

Simulation errors.

Enumerator
cannot_perform_timestep 

Slave is unable to perform a time step.

data_timeout 

Communications timeout between slaves.

Function Documentation

std::string coral::error::ErrnoMessage ( const std::string msg,
int  errnoValue 
)

Constructs an error message by combining a user-defined message and a standard system error message.

The system error message is obtained by calling std::strerror(errnoValue). If errnoValue is zero, the function only returns msg. Otherwise, if msg is empty, only the system message is returned. Otherwise, the format of the returned message is:

user message (system message)