Generic class for MoReFEM exceptions.
More...
#include <Exception.hpp>
|
virtual const char * | what () const noexcept override final |
| Display the what message from std::exception.
|
|
const std::string & | GetRawMessage () const noexcept |
| Display the raw message (Without file and line).
|
|
|
| Exception (const std::string &msg, const std::source_location location=std::source_location::current()) |
| Constructor with simple message.
|
|
virtual | ~Exception () noexcept override |
| Destructor.
|
|
| Exception (const Exception &rhs)=default |
| The copy constructor.
|
|
| Exception (Exception &&rhs)=default |
| The move constructor.
|
|
Exception & | operator= (const Exception &rhs)=default |
| The (copy) operator=.
|
|
Exception & | operator= (Exception &&rhs)=default |
| The (move) operator=.
|
|
|
std::string | what_message_ |
| The complete what() message (with the location part)
|
|
std::string | raw_message_ |
| Incomplete message (might be useful if we catch an exception to tailor a more specific message).
|
|
Generic class for MoReFEM exceptions.
◆ Exception() [1/3]
MoReFEM::Exception::Exception |
( |
const std::string & | msg, |
|
|
const std::source_location | location = std::source_location::current() ) |
|
explicit |
Constructor with simple message.
- Parameters
-
- Parameters
-
[in] | location | STL object with relevant information about the calling site (usually to help when an exception is thrown. |
◆ ~Exception()
virtual MoReFEM::Exception::~Exception |
( |
| ) |
|
|
overridevirtualnoexcept |
Destructor.
Reimplemented in MoReFEM::ExceptionNS::BoundaryConditionNS::Exception, MoReFEM::Internal::FromCoordsMatchingNS::Exception, MoReFEM::Internal::ExceptionsNS::Movemesh::Exception, MoReFEM::ExceptionNS::DofNS::Exception, MoReFEM::ExceptionNS::QuadratureRuleListNS::Exception, MoReFEM::Internal::RefFEltNS::BasicRefFEltFactoryNS::ExceptionNS::Exception, MoReFEM::ExceptionNS::GeometricElt::Exception, MoReFEM::ExceptionNS::Factory::GeometricElt::Exception, MoReFEM::ExceptionNS::GeometricEltList::Exception, MoReFEM::ExceptionNS::Format::Exception, MoReFEM::Wrappers::ExceptionNS::Mpi::Exception, MoReFEM::Wrappers::Parmetis::ExceptionNS::Exception, MoReFEM::Wrappers::Petsc::ExceptionNS::Exception, MoReFEM::ExceptionNS::Factory::Exception, MoReFEM::FilesystemNS::DirectoryNS::ExceptionNS::Exception, MoReFEM::InputDataNS::ExceptionNS::Exception, and MoReFEM::Internal::ExceptionsNS::UniqueId::Exception.
◆ Exception() [2/3]
MoReFEM::Exception::Exception |
( |
const Exception & | rhs | ) |
|
|
default |
The copy constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ Exception() [3/3]
MoReFEM::Exception::Exception |
( |
Exception && | rhs | ) |
|
|
default |
The move constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ operator=() [1/2]
The (copy) operator=.
- Parameters
-
[in] | rhs | The object from which the affectation occurs. |
- Returns
- Reference to the object (to enable chained affectation).
◆ operator=() [2/2]
The (move) operator=.
- Parameters
-
[in] | rhs | The object from which the affectation occurs. |
- Returns
- Reference to the object (to enable chained affectation).
◆ what()
virtual const char * MoReFEM::Exception::what |
( |
| ) |
const |
|
finaloverridevirtualnoexcept |
Display the what message from std::exception.
- Returns
- The what() message as a char* (which reads the internal std::string so no risk of deallocation issue).
◆ GetRawMessage()
const std::string & MoReFEM::Exception::GetRawMessage |
( |
| ) |
const |
|
noexcept |
Display the raw message (Without file and line).
Might be useful if exception is caught to rewrite a more refined message.
Before introducing this, we could end up in some cases with something like:
* Exception caught: Exception found at Sources/Model/Internal/InitializeHelper.hxx, line 114: Ill-defined
* finite element space 1: Exception found at Sources/Model/Internal/InitializeHelper.hxx, line 101:
* Domain 1 is not defined!
*
Clearly it is nicer to provide:
* Exception caught: Exception found at Sources/Model/Internal/InitializeHelper.hxx, line 114: Ill-defined
* finite element space 1: Domain 1 is not defined!
*
- Returns
- Exception error message without information about file and line in which the exception was invoked.
The documentation for this class was generated from the following file:
- /builds/2mk6rsew/0/MoReFEM/CoreLibrary/MoReFEM/Sources/Utilities/Exceptions/Exception.hpp