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

#include <KnowRobError.h>

Inheritance diagram for knowrob::KnowRobError:
Collaboration diagram for knowrob::KnowRobError:

Public Member Functions

 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
 

Protected Attributes

std::optional< std::string > file_
 
int line_
 

Detailed Description

A runtime error that is thrown when an error occurs in KnowRob.

Definition at line 16 of file KnowRobError.h.

Constructor & Destructor Documentation

◆ KnowRobError() [1/8]

KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.

Definition at line 19 of file KnowRobError.cpp.

20  : std::runtime_error(makeWhat(exc_type, exc_msg, "")), line_(0) {
21 }

◆ KnowRobError() [2/8]

KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  trace 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
traceA stack trace.

Definition at line 23 of file KnowRobError.cpp.

24  : std::runtime_error(makeWhat(exc_type, exc_msg, exc_trace)), line_(0) {
25 }

◆ KnowRobError() [3/8]

KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  file,
int  line 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
fileThe file where the error occurred.
lineThe line where the error occurred.

Definition at line 27 of file KnowRobError.cpp.

28  : std::runtime_error(makeWhat(exc_type, exc_msg, "")), file_(exc_file), line_(exc_line) {
29 }
std::optional< std::string > file_
Definition: KnowRobError.h:74

◆ KnowRobError() [4/8]

KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  file,
int  line,
std::string_view  trace 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
fileThe file where the error occurred.
lineThe line where the error occurred.
traceA stack trace.

Definition at line 31 of file KnowRobError.cpp.

33  : std::runtime_error(makeWhat(exc_type, exc_msg, exc_trace)), file_(exc_file), line_(exc_line) {
34 }

◆ KnowRobError() [5/8]

knowrob::KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.

◆ KnowRobError() [6/8]

knowrob::KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  trace 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
traceA stack trace.

◆ KnowRobError() [7/8]

knowrob::KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  file,
int  line 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
fileThe file where the error occurred.
lineThe line where the error occurred.

◆ KnowRobError() [8/8]

knowrob::KnowRobError::KnowRobError ( std::string_view  exc_type,
std::string_view  msg,
std::string_view  file,
int  line,
std::string_view  trace 
)
Parameters
exc_typeA short description of the exception type.
msgA message describing the error.
fileThe file where the error occurred.
lineThe line where the error occurred.
traceA stack trace.

Member Function Documentation

◆ file() [1/2]

auto knowrob::KnowRobError::file ( ) const
inline
Returns
the file where the error occurred.

Definition at line 61 of file KnowRobError.h.

61 { return file_; }

◆ file() [2/2]

auto knowrob::KnowRobError::file ( ) const
inline
Returns
the file where the error occurred.

Definition at line 61 of file KnowRobError.h.

61 { return file_; }

◆ hasFile() [1/2]

bool knowrob::KnowRobError::hasFile ( ) const
inline
Returns
true if the error has a file, false otherwise.

Definition at line 71 of file KnowRobError.h.

71 { return file_.has_value(); }

◆ hasFile() [2/2]

bool knowrob::KnowRobError::hasFile ( ) const
inline
Returns
true if the error has a file, false otherwise.

Definition at line 71 of file KnowRobError.h.

71 { return file_.has_value(); }

◆ line() [1/2]

auto knowrob::KnowRobError::line ( ) const
inline
Returns
the line where the error occurred.

Definition at line 66 of file KnowRobError.h.

66 { return line_; }

◆ line() [2/2]

auto knowrob::KnowRobError::line ( ) const
inline
Returns
the line where the error occurred.

Definition at line 66 of file KnowRobError.h.

66 { return line_; }

◆ setFile() [1/2]

void knowrob::KnowRobError::setFile ( std::string_view  file)
inline
Parameters
fileThe file where the error occurred.

Definition at line 51 of file KnowRobError.h.

51 { file_ = file; }

◆ setFile() [2/2]

void knowrob::KnowRobError::setFile ( std::string_view  file)
inline
Parameters
fileThe file where the error occurred.

Definition at line 51 of file KnowRobError.h.

51 { file_ = file; }

◆ setLine() [1/2]

void knowrob::KnowRobError::setLine ( int  line)
inline
Parameters
lineThe line where the error occurred.

Definition at line 56 of file KnowRobError.h.

56 { line_ = line; }

◆ setLine() [2/2]

void knowrob::KnowRobError::setLine ( int  line)
inline
Parameters
lineThe line where the error occurred.

Definition at line 56 of file KnowRobError.h.

56 { line_ = line; }

Member Data Documentation

◆ file_

std::optional< std::string > knowrob::KnowRobError::file_
protected

Definition at line 74 of file KnowRobError.h.

◆ line_

int knowrob::KnowRobError::line_
protected

Definition at line 75 of file KnowRobError.h.


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