Exception
Exception class with formatted output capabilities.
Defined in Rodin/Alert/Exception.h
class Exception;
A specialized exception class that extends both std::exception and the Alert messaging system. When raised, it outputs a formatted error message with red coloring and terminates the program.
The Exception class provides stream-like insertion operators for building detailed error messages with formatting capabilities.
- exception
- Message
Inherits from
| Base class | Responsibility |
|---|---|
exceptionpublicFull typeexception
| |
Message<ExceptionPrefix>publicFull typeMessage< ExceptionPrefix > | Forward declaration of the Message template class. |
Derived classes
| Derived class | Description |
|---|---|
ClassException<T>publicFull typeClassException< T > | Exception class that automatically includes the class name. |
MemberFunctionException<T, FuncName>publicFull typeMemberFunctionException< T, FuncName > | Exception type for errors occurring in member functions. |
NamespacedExceptionpublicFull typeNamespacedException
| Exception class that automatically includes the namespace name. |
See moreSee less
| Derived class | Description |
|---|---|
MMG::MMG5Exception<FuncName>publicFull typeMMG::MMG5Exception< FuncName > | Exception type for MMG wrapper failures. |
Variational::TestFunctionMismatchExceptionpublicFull typeVariational::TestFunctionMismatchException | Raised when an expression is combined with a foreign test function. |
Variational::TrialFunctionMismatchExceptionpublicFull typeVariational::TrialFunctionMismatchException | Raised when an expression is combined with a foreign trial function. |
Overrides
| Member | Base declaration |
|---|---|
raise() | Message::raise |
Inherited interface
| Declared in | Members |
|---|---|
Message |
Public types
- using Parent = Message<ExceptionPrefix>
- Parent class type alias.
Constructors, destructors, conversion operators
Public functions
Function documentation
Exception()
Constructs an Exception with an empty message.
Creates an exception that outputs to std::cerr by default.
Exception(std::ostream& os)
Constructs an Exception with a specific output stream.
| Parameters | |
|---|---|
| os | The output stream to write the error message to. |
Exception(const Exception& other)
Copy constructor.
| Parameters | |
|---|---|
| other | The Exception object to copy from. |
void raise() const override
Raises the exception to the user.
Outputs a formatted error message to the configured stream and throws a copy of this exception. The message includes the exception prefix and any accumulated message content.
const char* what() const override noexcept
Returns the exception message.
| Returns | A C-style string containing the exception message. |
|---|
This method provides compatibility with std::exception::what().