libMesh
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
libMesh::SolverException Class Reference

A class representing an exception during a solve. More...

#include <libmesh_exceptions.h>

Inheritance diagram for libMesh::SolverException:
[legend]

Public Member Functions

 SolverException (int error_code_in)
 
virtual ~SolverException ()=default
 Virtual destructor, gotta have one of those.
 
virtual const char * what () const noexcept override
 Override the what() function to provide a generic error message.
 

Public Attributes

int error_code
 The error code generated by the solver.
 
std::string what_message
 string which holds the message built in the constructor.
 

Detailed Description

A class representing an exception during a solve.

Definition at line 160 of file libmesh_exceptions.h.

Constructor & Destructor Documentation

◆ SolverException()

libMesh::SolverException::SolverException ( int  error_code_in)
inline

Definition at line 163 of file libmesh_exceptions.h.

163 :
164 std::exception(),
165 error_code(error_code_in)
166 {
167 std::ostringstream oss;
168 oss << "Error code " << error_code << " during solve." << std::endl;
169 what_message = oss.str();
170 }
int error_code
The error code generated by the solver.
std::string what_message
string which holds the message built in the constructor.

References error_code, and what_message.

◆ ~SolverException()

virtual libMesh::SolverException::~SolverException ( )
virtualdefault

Virtual destructor, gotta have one of those.

Member Function Documentation

◆ what()

virtual const char * libMesh::SolverException::what ( ) const
inlineoverridevirtualnoexcept

Override the what() function to provide a generic error message.

Definition at line 180 of file libmesh_exceptions.h.

181 {
182 // std::string::c_str() is noexcept in C++11, so it's safe to call
183 // in what() because it can't throw.
184 return what_message.c_str();
185 }

References what_message.

Member Data Documentation

◆ error_code

int libMesh::SolverException::error_code

The error code generated by the solver.

Definition at line 190 of file libmesh_exceptions.h.

Referenced by libMesh::PetscSolverException::PetscSolverException(), and SolverException().

◆ what_message

std::string libMesh::SolverException::what_message

string which holds the message built in the constructor.

Definition at line 195 of file libmesh_exceptions.h.

Referenced by libMesh::PetscSolverException::PetscSolverException(), SolverException(), and what().


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