libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
introvirt::TraceableException Class Reference

Base class for exceptions with stack unwinding. More...

#include <TraceableException.hh>

Inheritance diagram for introvirt::TraceableException:
Collaboration diagram for introvirt::TraceableException:

Public Member Functions

int error_code () const
 Get the errno value if one was set.
 
 TraceableException (TraceableException &&) noexcept
 Move constructor.
 
TraceableExceptionoperator= (TraceableException &&) noexcept
 Move assignment operator.
 
 ~TraceableException () override
 Destroy the instance.
 

Protected Member Functions

 TraceableException (const std::string &msg)
 Construct a new Traceable Exception object.
 
 TraceableException (const std::string &msg, int err)
 Construct a new Traceable Exception object with an erro code.
 

Friends

std::ostream & operator<< (std::ostream &os, const TraceableException &error)
 Write this exception to a stream.
 

Detailed Description

Base class for exceptions with stack unwinding.

This is a base class for other, more specific exceptions. It can print out the stack trace leading to the exception.

Examples
ivexec.cc, ivprocinfo.cc, ivservicetable.cc, and vmcall_interface.cc.

Constructor & Destructor Documentation

◆ TraceableException() [1/3]

introvirt::TraceableException::TraceableException ( TraceableException &&  )
noexcept

Move constructor.

◆ ~TraceableException()

introvirt::TraceableException::~TraceableException ( )
override

Destroy the instance.

◆ TraceableException() [2/3]

introvirt::TraceableException::TraceableException ( const std::string &  msg)
explicitprotected

Construct a new Traceable Exception object.

Parameters
msgThe error message

◆ TraceableException() [3/3]

introvirt::TraceableException::TraceableException ( const std::string &  msg,
int  err 
)
protected

Construct a new Traceable Exception object with an erro code.

Parameters
msgThe error message
errThe errno value

Member Function Documentation

◆ error_code()

int introvirt::TraceableException::error_code ( ) const

Get the errno value if one was set.

Returns
The errno value if one was set, 0 otherwise.

◆ operator=()

TraceableException & introvirt::TraceableException::operator= ( TraceableException &&  )
noexcept

Move assignment operator.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const TraceableException error 
)
friend

Write this exception to a stream.

Parameters
osThe output stream to write to
errorThe exception to write
Returns
std::ostream& The stream that was provided

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