iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::exception::BlackboardException Class Reference

#include <nrt/Core/Blackboard/Exceptions.H>

Class for Blackboard exceptions.

Examples:
tests/test-Module.C.

Definition at line 68 of file Exceptions.H.

Inheritance diagram for nrt::exception::BlackboardException:
nrt::exception::SerializableException nrt::exception::Exception

Classes

class  BlackboardExceptionData
 Data stored about an exception, we have a vector of those to simulate a stack unwinding. More...
 

Public Types

enum  ErrorType {
  Unknown = 0, InternalInconsistency = 1, UnknownMessageType = 2, UnknownPoster = 3,
  UnknownChecker = 4, UnknownSubscriber = 5, SuspendedBlackboard = 6, MessageSerializationError = 7,
  NetworkError = 8, PropagatedError = 9, MalformedTopic = 10, UnknownModule = 11,
  BadNamespace = 12, NotModule = 13, NotBlackboardMaster = 14, InvalidNickname = 15,
  ExceptionSerializationError = 16, UnsplittablePort = 17, BadAnyMessageCast = 18, UnknownConnector = 19,
  WrongVersion = 20, HTTPBridgeError = 21, UnknownBlackboard = 22, BadInstanceName = 23
}
 Type of Blackboard error. More...
 

Public Member Functions

 BlackboardException () throw ()
 Construct from nothing, needed by serialization but contains no valid data.
 
 BlackboardException (ErrorType const et, std::string const &wherestr, std::string const &whatstr) throw ()
 Standard constructor.
 
 BlackboardException (BlackboardException const &e) throw ()
 Copy constructor.
 
virtual ~BlackboardException () throw ()
 Destructor.
 
BlackboardExceptionoperator= (BlackboardException const &e) throw ()
 Assignment.
 
std::vector
< BlackboardExceptionData >
const & 
fulldata () const
 Get stack trace.
 
std::string const str () const
 Dump some informational description to string, full stack trace.
 
char const * errorString (ErrorType const et) const
 Convert ErrorType to string.
 
- Public Member Functions inherited from nrt::exception::SerializableException
 SerializableException () throw ()
 Default constructor.
 
 SerializableException (char const *msg) throw ()
 Construct from a C string message.
 
 SerializableException (SerializableException const &e) throw ()
 Copy constructor.
 
virtual ~SerializableException () throw ()
 Destructor.
 
SerializableExceptionoperator= (SerializableException const &e) throw ()
 Assignment.
 
- Public Member Functions inherited from nrt::exception::Exception
 Exception () throw ()
 Constructor with a default non-specific error message.
 
 Exception (char const *msg) throw ()
 Constructor with a given error message. More...
 
 Exception (Exception const &e) throw ()
 Copy constructor.
 
virtual ~Exception () throw ()
 Virtual destructor for safe inheritance.
 
Exceptionoperator= (Exception const &e) throw ()
 Assignment.
 
char const * what () const throw ()
 Return a C string describing the error. More...
 

Protected Member Functions

void adddata (BlackboardExceptionData const &d)
 Add more data, catchAndRethrow() does it.
 
template<class Archive >
void serialize (Archive &ar)
 Serialize object into/out of an archive.
 
- Protected Member Functions inherited from nrt::exception::SerializableException
template<class Archive >
void serialize (Archive &ar)
 Serialization.
 

Protected Attributes

std::vector
< BlackboardExceptionData
data
 Our accumulated data.
 
- Protected Attributes inherited from nrt::exception::SerializableException
std::string whatstring
 The string representing the exception message.
 
- Protected Attributes inherited from nrt::exception::Exception
char const * whatptr
 Pointer to a message, returned by what()
 

Friends

class cereal::access
 
void nrt::blackboard::catchAndRethrow (std::string const &bbwhere, nrt::ModuleBase *mod)
 

Member Enumeration Documentation

Type of Blackboard error.

Note
NRT programmers: if you add a type here, be sure to also update the definition of errorString() in Exceptions.C
Enumerator
Unknown 

Unknown Blackboard error.

InternalInconsistency 

Internal Inconsistency, severe, e.g., missing keys or entries in our internal tables.

UnknownMessageType 

Unknown message type, e.g., some posted message has a type we don't know about, message was lost.

This may just mean that we received a message because we used to have a subscriber for it, but by the time the message arrives that subscriber is gone. It is not a severe inconsistency in the Blackboard but this exception signals that the message was lost.

UnknownPoster 

We don't know this MessagePoster.

This may be thrown if trying to set the namespace or topic of an unknown MessagePoster.

UnknownChecker 

We don't know this MessageChecker.

This may be thrown if trying to set the namespace or topic filter of an unknown MessageChecker. It may also be thrown if we have no checker key for an incoming remote check() request. Our corresponding poster(s) may have recently disappeared. This exception signals that the remote check() request will be ignored.

UnknownSubscriber 

We don't know this MessageSubscriber.

This may be thrown if trying to set the namespace or topic filter of an unknown MessageSubscriber. It may also be thrown if we have no subscriber for an incoming remotely posted message, while the remote poster thought we had one. The subscriber may have recently disappeared. This exception signals that the subscriber's callback will not be called although the caller expects it to be.

SuspendedBlackboard 

Suspended Blackboard (not running) refused to serve a post(), posted message was ignored and lost.

MessageSerializationError 

Something went wrong during serialization/deserialization of a message.

NetworkError 

Network error when communicating with a remote Blackboard or in setting up communications with master.

PropagatedError 

Propagated error, an error was caught and is being propagated with more info about who caught it.

MalformedTopic 

Malformed Topic Filter or Topic, caused std::regex to throw.

UnknownModule 

Module could not be found (e.g., when trying to set a module's namespace)

BadNamespace 

The given Namespace string was bad (either missing a link, or otherwise malformed)

NotModule 

A poster, subscription, or checker port is not associated with a module.

NotBlackboardMaster 

Some operation only supported by master Blackboard was attempted on a non-master.

InvalidNickname 

Attempted to have two different blackboards with the same nickname, or to use an otherwise phony nick.

ExceptionSerializationError 

Error occurred while trying to serialize/deserialize an exception.

UnsplittablePort 

Attempted to split a port that cannot be split (has an atomic message, or non-void return type)

BadAnyMessageCast 

Attempted to cast an nrt::AnyMessage to something else than the actual contained message type.

UnknownConnector 

Attempted to set topic/filter on a connector we don't know.

WrongVersion 

Attempted to load a module with wrong version.

HTTPBridgeError 

HTTPBridge error.

UnknownBlackboard 

Unknown blackboard uid or nick.

BadInstanceName 

Duplicate instance name.

Definition at line 74 of file Exceptions.H.


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