knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::mongo::MongoException Class Reference

#include <MongoException.h>

Inheritance diagram for knowrob::mongo::MongoException:
Collaboration diagram for knowrob::mongo::MongoException:

Public Member Functions

 MongoException (const char *msg, const bson_error_t &err)
 
 MongoException (const char *msg, const bson_error_t &err)
 
- Public Member Functions inherited from knowrob::StorageError
template<typename ... Args>
 StorageError (const char *fmt, Args &&... args)
 
template<typename ... Args>
 StorageError (const char *fmt, Args &&... args)
 
- Public Member Functions inherited from knowrob::KnowRobError
 KnowRobError (std::string_view exc_type, std::string_view msg)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view trace)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view file, int line)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view file, int line, std::string_view trace)
 
void setFile (std::string_view file)
 
void setLine (int line)
 
auto file () const
 
auto line () const
 
bool hasFile () const
 
 KnowRobError (std::string_view exc_type, std::string_view msg)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view trace)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view file, int line)
 
 KnowRobError (std::string_view exc_type, std::string_view msg, std::string_view file, int line, std::string_view trace)
 
void setFile (std::string_view file)
 
void setLine (int line)
 
auto file () const
 
auto line () const
 
bool hasFile () const
 

Public Attributes

const std::string bsonMessage_
 
const std::string contextMessage_
 

Additional Inherited Members

- Protected Attributes inherited from knowrob::KnowRobError
std::optional< std::string > file_
 
int line_
 

Detailed Description

A runtime exception that occurred when interacting with Mongo DB.

Definition at line 11 of file MongoException.h.

Constructor & Destructor Documentation

◆ MongoException() [1/2]

knowrob::mongo::MongoException::MongoException ( const char *  msg,
const bson_error_t &  err 
)
inline

Definition at line 13 of file MongoException.h.

14  : StorageError("[mongo] {}: {}.", msg, err.message),
15  bsonMessage_(err.message),
16  contextMessage_(msg) {}
StorageError(const char *fmt, Args &&... args)
Definition: StorageError.h:24
const std::string bsonMessage_
const std::string contextMessage_

◆ MongoException() [2/2]

knowrob::mongo::MongoException::MongoException ( const char *  msg,
const bson_error_t &  err 
)
inline

Definition at line 13 of file MongoException.h.

14  : StorageError("[mongo] {}: {}.", msg, err.message),
15  bsonMessage_(err.message),
16  contextMessage_(msg) {}

Member Data Documentation

◆ bsonMessage_

const std::string knowrob::mongo::MongoException::bsonMessage_

Definition at line 17 of file MongoException.h.

◆ contextMessage_

const std::string knowrob::mongo::MongoException::contextMessage_

Definition at line 18 of file MongoException.h.


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