Psi4
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
psi::PsiException Class Reference

#include <exception.h>

Inheritance diagram for psi::PsiException:
psi::DataTypeException psi::DuplicateKeyException psi::FeatureNotImplemented psi::IndexException psi::InputException psi::LimitExceeded< T > psi::NotImplementedException_ psi::OptionsException psi::SanityCheckError psi::SystemError

Public Member Functions

 PsiException (std::string message, const char *file, int line) noexcept
 
 PsiException (const PsiException &copy) noexcept
 
virtual ~PsiException () noexcept
 
PsiExceptionoperator= (const PsiException &other)
 
const char * what () const noexcept
 
const char * file () const noexcept
 
const char * location () const noexcept
 
int line () const noexcept
 

Protected Member Functions

void rewrite_msg (std::string msg) noexcept
 

Private Attributes

std::string msg_
 
const char * file_
 
int line_
 

Detailed Description

Generic exception class for Psi4

Constructor & Destructor Documentation

psi::PsiException::PsiException ( std::string  message,
const char *  file,
int  line 
)
noexcept

Constructor

Parameters
messageThe message that will be printed by exception
fileThe file that threw the exception (use FILE macro)
lineThe line number that threw the exception (use LINE macro)
psi::PsiException::PsiException ( const PsiException copy)
noexcept
psi::PsiException::~PsiException ( )
virtualnoexcept

Member Function Documentation

const char * psi::PsiException::file ( ) const
noexcept

Accessor method

Returns
File that threw the exception
int psi::PsiException::line ( ) const
noexcept

Accessor method

Returns
The line number that threw the exception
const char * psi::PsiException::location ( ) const
noexcept

Accessor method

Returns
A string description of line and file that threw exception
PsiException& psi::PsiException::operator= ( const PsiException other)
inline
void psi::PsiException::rewrite_msg ( std::string  msg)
protectednoexcept

Override default message for exception throw in what

Parameters
msgThe message for what to throw
const char * psi::PsiException::what ( ) const
noexcept

Override of runtime_error's virtual what method

Returns
Description of exception

Member Data Documentation

const char* psi::PsiException::file_
private
int psi::PsiException::line_
private
std::string psi::PsiException::msg_
private

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