libMesh
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 () noexcept
 Virtual destructor, gotta have one of those. More...
 
virtual const char * what () const noexcept
 Override the what() function to provide a generic error message. More...
 

Public Attributes

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

Detailed Description

A class representing an exception during a solve.

Definition at line 107 of file libmesh_exceptions.h.

Constructor & Destructor Documentation

◆ SolverException()

libMesh::SolverException::SolverException ( int  error_code_in)

Definition at line 110 of file libmesh_exceptions.h.

References error_code, and what_message.

110  :
111  std::exception(),
112  error_code(error_code_in)
113  {
114  std::ostringstream oss;
115  oss << "Error code " << error_code << " during solve." << std::endl;
116  what_message = oss.str();
117  }
int error_code
The error code generated by the solver.
std::string what_message
string which holds the message built in the constructor.

◆ ~SolverException()

virtual libMesh::SolverException::~SolverException ( )
virtualnoexcept

Virtual destructor, gotta have one of those.

Definition at line 122 of file libmesh_exceptions.h.

122 {};

Member Function Documentation

◆ what()

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

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

Definition at line 127 of file libmesh_exceptions.h.

References what_message.

128  {
129  // std::string::c_str() is noexcept in C++11, so it's safe to call
130  // in what() because it can't throw.
131  return what_message.c_str();
132  }
std::string what_message
string which holds the message built in the constructor.

Member Data Documentation

◆ error_code

int libMesh::SolverException::error_code

The error code generated by the solver.

Definition at line 137 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 142 of file libmesh_exceptions.h.

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


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