|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Augments an exception with the source file and line.
| baseexcept | is the base class exception which takes a string as constructor argument |
Definition at line 41 of file exception.hpp.
#include <error/exception.hpp>
Inherits std::exception.
Public Member Functions | |
| exception (const std::source_location loc=std::source_location::current()) | |
| Constructor with location only. | |
| exception (const std::string &msg, const std::source_location loc=std::source_location::current()) | |
| Constructor with message. | |
| exception (error_t code, const std::string &msg, const std::source_location loc=std::source_location::current()) | |
| Constructor with message and cod. | |
| exception (error_t code, const std::source_location loc=std::source_location::current()) | |
| Constructor with code. | |
| virtual const char * | what () const noexcept |
| Get the what string. | |
| const std::string & | message () const |
| Get the message. | |
| const std::string | file_name () const |
| Get the source file. | |
| int | line () const |
| Get the source line. | |
| error_t | code () const |
| Get the error code. | |
Protected Attributes | |
| std::string | m_what |
| The full what message (message + file information). | |
| error_t | m_code { error_t::exception } |
| The error_t code. | |
| std::string | m_message |
| The explanatory message. | |
|
inlineexplicit |
Constructor with location only.
| [in] | loc | [opt] the location where this was thrown |
Definition at line 56 of file exception.hpp.
References mx::exception< verboseT >::m_code, and mx::exception< verboseT >::m_what.
|
inlineexplicit |
Constructor with message.
| [in] | msg | the error description message) |
| [in] | loc | [opt] the location where this was thrown |
Definition at line 66 of file exception.hpp.
References mx::exception< verboseT >::m_code, mx::exception< verboseT >::m_message, and mx::exception< verboseT >::m_what.
|
inline |
Constructor with message and cod.
| [in] | code | a descriptive error code |
| [in] | msg | the error description (what message) |
| [in] | loc | [opt] the location where this was thrown |
Definition at line 77 of file exception.hpp.
References mx::exception< verboseT >::m_code, mx::exception< verboseT >::m_message, and mx::exception< verboseT >::m_what.
|
inline |
Constructor with code.
The message is filled in using errorMessage.
The what() message becomes "code_message (code) [file line]".
| [in] | code | a descriptive error code |
| [in] | loc | [opt] the location where this was thrown |
Definition at line 91 of file exception.hpp.
References mx::exception< verboseT >::m_code, and mx::exception< verboseT >::m_what.
|
inline |
Get the error code.
Definition at line 139 of file exception.hpp.
References mx::exception< verboseT >::m_code.
Referenced by mx::ioutils::dir_exists_is(), and mx::ioutils::exists().
|
inline |
Get the source file.
Definition at line 121 of file exception.hpp.
|
inline |
Get the source line.
Definition at line 130 of file exception.hpp.
|
inline |
Get the message.
Definition at line 112 of file exception.hpp.
References mx::exception< verboseT >::m_message.
|
inlinevirtualnoexcept |
Get the what string.
Definition at line 103 of file exception.hpp.
References mx::exception< verboseT >::m_what.
|
protected |
The error_t code.
Definition at line 46 of file exception.hpp.
Referenced by mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), and mx::exception< verboseT >::code().
|
protected |
The explanatory message.
Definition at line 48 of file exception.hpp.
Referenced by mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), and mx::exception< verboseT >::message().
|
protected |
The full what message (message + file information).
Definition at line 44 of file exception.hpp.
Referenced by mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), mx::exception< verboseT >::exception(), and mx::exception< verboseT >::what().