Rosetta  2019.35
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
utility::excn::Exception Class Reference

#include <Exceptions.hh>

Inheritance diagram for utility::excn::Exception:
Inheritance graph
[legend]

Public Member Functions

 Exception ()=delete
 
 Exception (char const *file, int line, std::string const &msg)
 
virtual ~Exception ()
 
virtual void display () const
 Present this exception to the user. Will invoke crash log reporting, if applicable. More...
 
virtual void crash_log () const
 Invoke a crash log for throwing this exception. If your exception is one which is a "non-error" exception, override this function to do nothing. More...
 
void show (std::ostream &) const
 
std::string msg () const
 Will return a formatted message (with file/line information) More...
 
std::string raw_msg () const
 Will return the raw message (without file/line information) More...
 
void msg (std::string const &m)
 Will set the raw message. More...
 
void add_msg (std::string const &str)
 
void prepend_to_msg (std::string const &str)
 
std::string const & file ()
 
int line ()
 
std::string const & traceback ()
 

Private Member Functions

char const * what () const noexceptoverride
 

Private Attributes

std::string msg_
 
std::string file_
 
int line_
 
std::string traceback_
 
std::string whatstring_
 

Constructor & Destructor Documentation

utility::excn::Exception::Exception ( )
delete
Exception::Exception ( char const *  file,
int  line,
std::string const &  msg 
)
virtual utility::excn::Exception::~Exception ( )
inlinevirtual

Member Function Documentation

void utility::excn::Exception::add_msg ( std::string const &  str)
inline

References msg_.

void Exception::crash_log ( ) const
virtual

Invoke a crash log for throwing this exception. If your exception is one which is a "non-error" exception, override this function to do nothing.

Reimplemented in utility::excn::UserCorrectableIssue, utility::excn::FileNotFound, and utility::graph::EXCN_Stop_BFS.

References file_, line_, msg_, utility::save_crash_report(), and traceback_.

Referenced by display(), and utility::terminate_handler().

void Exception::display ( ) const
virtual

Present this exception to the user. Will invoke crash log reporting, if applicable.

Reimplemented in utility::excn::UserCorrectableIssue.

References utility::io::oc::cerr, crash_log(), utility::CSI_Magenta(), utility::CSI_Reset(), and msg().

Referenced by main().

std::string const& utility::excn::Exception::file ( )
inline

References file_.

int utility::excn::Exception::line ( )
inline

References line_.

std::string Exception::msg ( ) const
void utility::excn::Exception::msg ( std::string const &  m)
inline

Will set the raw message.

References test.T110_Numeric::m, and msg_.

void utility::excn::Exception::prepend_to_msg ( std::string const &  str)
inline

References msg_.

std::string utility::excn::Exception::raw_msg ( ) const
inline

Will return the raw message (without file/line information)

References msg_.

Referenced by utility::excn::UserCorrectableIssue::display().

void Exception::show ( std::ostream &  os) const

References msg().

Referenced by my_main(), and utility::excn::operator<<().

std::string const& utility::excn::Exception::traceback ( )
inline

References traceback_.

char const* utility::excn::Exception::what ( ) const
inlineoverrideprivatenoexcept

References msg(), and whatstring_.

Member Data Documentation

std::string utility::excn::Exception::file_
private

Referenced by crash_log(), file(), and msg().

int utility::excn::Exception::line_
private

Referenced by crash_log(), line(), and msg().

std::string utility::excn::Exception::msg_
private
std::string utility::excn::Exception::traceback_
private

Referenced by crash_log(), and traceback().

std::string utility::excn::Exception::whatstring_
mutableprivate

Referenced by what().


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