Rosetta
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)
 
 ~Exception () override
 
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 noexcept override
 

Private Attributes

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

Constructor & Destructor Documentation

◆ Exception() [1/2]

utility::excn::Exception::Exception ( )
delete

◆ Exception() [2/2]

Exception::Exception ( char const *  file,
int  line,
std::string const &  msg 
)

◆ ~Exception()

utility::excn::Exception::~Exception ( )
inlineoverride

Member Function Documentation

◆ add_msg()

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

References msg_, and str().

◆ crash_log()

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::graph::EXCN_Stop_BFS, utility::excn::UserCorrectableIssue, and utility::excn::FileNotFound.

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

Referenced by display().

◆ display()

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().

◆ file()

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

References file_.

◆ line()

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

References line_.

◆ msg() [1/2]

std::string Exception::msg ( ) const

Will return a formatted message (with file/line information)

References file_, line_, msg_, and numeric::interpolation::to_string().

Referenced by display(), RosettaJob::request_job_from_server(), nacl_rosetta::RosettaInstance::RosettaThread(), show(), and what().

◆ msg() [2/2]

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

Will set the raw message.

References kmeans_adaptive_kernel_density_bb_dependent_rotlib::m, and msg_.

◆ prepend_to_msg()

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

References msg_, and str().

◆ raw_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().

◆ show()

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

◆ traceback()

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

References traceback_.

◆ what()

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

References msg(), and whatstring_.

Member Data Documentation

◆ file_

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

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

◆ line_

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

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

◆ msg_

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

◆ traceback_

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

Referenced by crash_log(), and traceback().

◆ whatstring_

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

Referenced by what().


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