Loading...
Searching...
No Matches
OBError Class Reference

`#include <openbabel/oberror.h>`

## Public Member Functions

| OBError (const std::string &method="", const std::string &errorMsg="", const std::string &explanation="", const std::string &possibleCause="", const std::string &suggestedRemedy="", const obMessageLevel=obDebug)
std::string | message (void) const
std::string | GetMethod () const
std::string | GetError () const
std::string | GetExplanation () const
std::string | GetPossibleCause () const
std::string | GetSuggestedRemedy () const
obMessageLevel | GetLevel () const
bool | operator== (const OBError &) const

## Protected Attributes

std::string | _method
std::string | _errorMsg
std::string | _explanation
std::string | _possibleCause
std::string | _suggestedRemedy
obMessageLevel | _level

## Friends

std::ostream & | operator<< (std::ostream &os, const OBError &er)

## Detailed Description

Customizable error handling and logging – store a message, including the method yielding the error, causes, etc.

## Constructor & Destructor Documentation

## OBError()

OBError | ( | const std::string & | method = "",
|  | const std::string & | errorMsg = "",
|  | const std::string & | explanation = "",
|  | const std::string & | possibleCause = "",
|  | const std::string & | suggestedRemedy = "",
|  | const obMessageLevel | level = obDebug )

Constructor for an error message e.g. OBError(FUNCTION, " message ").

Referenced by operator<<, and operator==().

## Member Function Documentation

## message()

string message | ( | void |  | ) | const

Returns
  A formatted message string, including optional explanations, etc.

Referenced by OBMessageHandler::GetMessagesOfLevel(), and operator<<.

## GetMethod()

std::string GetMethod | ( |  | ) | const

inline

Returns
  The method which caused this error (typically supplied via the FUNCTION compiler macro

## GetError()

std::string GetError | ( |  | ) | const

inline

Returns
  The main error message

Referenced by operator==().

## GetExplanation()

std::string GetExplanation | ( |  | ) | const

inline

Returns
  A more detailed explanation of the error (optional)

## GetPossibleCause()

std::string GetPossibleCause | ( |  | ) | const

inline

Returns
  A possible cause for the error (optional)

## GetSuggestedRemedy()

std::string GetSuggestedRemedy | ( |  | ) | const

inline

Returns
  The suggested workaround or remedy for the error (optional)

## GetLevel()

obMessageLevel GetLevel | ( |  | ) | const

inline

Returns
  The severity level of this error

Referenced by OBMessageHandler::GetMessagesOfLevel(), and OBMessageHandler::ThrowError().

## operator==()

bool operator== | ( | const OBError & | other | ) | const

## Friends And Related Symbol Documentation

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const OBError & | er )

friend

Output a formatted message string.

## Member Data Documentation

## _method

std::string _method

protected

The method causing the error (typically from the compiler macro FUNCTION).

Referenced by GetMethod(), message(), and OBError().

## _errorMsg

std::string _errorMsg

protected

The actual error message.

Referenced by GetError(), message(), and OBError().

## _explanation

std::string _explanation

protected

Optional explanation message: more detailed than the brief error.

Referenced by GetExplanation(), message(), and OBError().

## _possibleCause

std::string _possibleCause

protected

Optional cause message.

Referenced by GetPossibleCause(), message(), and OBError().

## _suggestedRemedy

std::string _suggestedRemedy

protected

Optional workaround or remedy.

Referenced by GetSuggestedRemedy(), message(), and OBError().

## _level

obMessageLevel _level

protected

The severity level: used for filtering via OBMessageHandler.

Referenced by GetLevel(), message(), and OBError().

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

- oberror.h
- oberror.cpp