Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
Exception Struct Reference

Provides a convenient way to initialized an exception with helpful error messages. More...

#include <Exception.hpp>

Collaboration diagram for Exception:
[legend]

Public Attributes

std::stringstream error
 The error message to be displayed when the exception is raised.
 
std::stringstream reason
 The reason message to be displayed when the exception is raised.
 

Detailed Description

Provides a convenient way to initialized an exception with helpful error messages.

Usage Below we demonstrate a convenient way to raise an exception using an Exception instance.

using namespace Reaktoro;
Exception exception;
exception.error << "Cannot calculate the actitivy of species " << species.name() << ".";
exception.reason << "The species " << species.name() << " does not exist in the chemical system.";
RaiseError(exception);
#define RaiseError(exception)
Define a macro to raise a runtime exception from an Exception instance.
Definition: Exception.hpp:69
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
See also
raise

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