NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
error.hpp File Reference
#include <string>
#include <vector>
#include "language.hpp"
#include "../ParserLib/muParserDef.h"
Include dependency graph for error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SyntaxError
 Common exception class for all exceptions thrown in NumeRe. More...
 
struct  AssertionStats
 This structure accumulates the statistics for the assertion handler. More...
 
class  Assertion
 This class handles assertions and throws the corresponding exception, if the assertion fails. It is currently used as global singleton, but is not restricted to this pattern. More...
 

Enumerations

enum  ErrorType {
  TYPE_NOERROR , TYPE_ABORT , TYPE_MATHERROR , TYPE_SYNTAXERROR ,
  TYPE_ASSERTIONERROR , TYPE_CUSTOMERROR , TYPE_INTERNALERROR , TYPE_CRITICALERROR ,
  TYPE_GENERICERROR
}
 Defines the possible error types, which can be thrown in this application. More...
 

Functions

ErrorType getErrorType (std::exception_ptr e_ptr)
 This function obtains the error type of a catched exception and sets the last error message. More...
 
std::string getLastErrorMessage ()
 Return the last error message, which was catched by the getErrorType() function. More...
 
ErrorType getLastErrorType ()
 Return the last error type, which was catched by the getErrorType() function. More...
 
std::string errorTypeToString (ErrorType e)
 Return the error type converted to a human readable string. More...
 

Variables

Language _lang
 
Assertion _assertionHandler
 

Enumeration Type Documentation

◆ ErrorType

enum ErrorType

Defines the possible error types, which can be thrown in this application.

Enumerator
TYPE_NOERROR 
TYPE_ABORT 
TYPE_MATHERROR 
TYPE_SYNTAXERROR 
TYPE_ASSERTIONERROR 
TYPE_CUSTOMERROR 
TYPE_INTERNALERROR 
TYPE_CRITICALERROR 
TYPE_GENERICERROR 

Definition at line 468 of file error.hpp.

Function Documentation

◆ errorTypeToString()

std::string errorTypeToString ( ErrorType  e)

Return the error type converted to a human readable string.

Parameters
eErrorType
Returns
std::string

Definition at line 148 of file error.cpp.

References TYPE_ABORT, TYPE_ASSERTIONERROR, TYPE_CRITICALERROR, TYPE_CUSTOMERROR, TYPE_GENERICERROR, TYPE_INTERNALERROR, TYPE_MATHERROR, TYPE_NOERROR, and TYPE_SYNTAXERROR.

Referenced by NumeReKernel::defineConst(), strfnc_getlasterror(), and FlowCtrl::try_catch().

◆ getErrorType()

ErrorType getErrorType ( std::exception_ptr  e_ptr)

This function obtains the error type of a catched exception and sets the last error message.

Parameters
e_ptrstd::exception_ptr
Returns
ErrorType

Definition at line 42 of file error.cpp.

References _lang, SyntaxError::ASSERTION_ERROR, Language::get(), mu::ParserError::GetMsg(), SyntaxError::LOOP_THROW, nLastErrorType, SyntaxError::PROCEDURE_THROW, SyntaxError::PROCESS_ABORTED_BY_USER, sLastErrorMessage, toString(), TYPE_ABORT, TYPE_ASSERTIONERROR, TYPE_CRITICALERROR, TYPE_CUSTOMERROR, TYPE_GENERICERROR, TYPE_INTERNALERROR, TYPE_MATHERROR, TYPE_NOERROR, and TYPE_SYNTAXERROR.

Referenced by FlowCtrl::try_catch().

Here is the call graph for this function:

◆ getLastErrorMessage()

std::string getLastErrorMessage ( )

Return the last error message, which was catched by the getErrorType() function.

Returns
std::string

Definition at line 121 of file error.cpp.

References sLastErrorMessage.

Referenced by strfnc_getlasterror().

◆ getLastErrorType()

ErrorType getLastErrorType ( )

Return the last error type, which was catched by the getErrorType() function.

Returns
ErrorType

Definition at line 134 of file error.cpp.

References nLastErrorType.

Referenced by strfnc_getlasterror().

Variable Documentation

◆ _assertionHandler

◆ _lang