Frobby  0.9.5
Classes | Macros | Functions
error.h File Reference
#include <stdexcept>
#include <string>

Go to the source code of this file.

Classes

class  FrobbyException
 This is the base of the Frobby exception hierarchy for exceptions that can occur due to expected error conditions. More...
 
class  InternalFrobbyException
 This exception signals that a bug in Frobby has been detected. More...
 

Macros

#define INTERNAL_ERROR(msg)
 
#define INTERNAL_ERROR_UNIMPLEMENTED()    INTERNAL_ERROR("Called function that has not been implemented.")
 
#define DEFINE_EXCEPTION(NAME)
 

Functions

void reportError (const string &errorMsg)
 
void reportInternalError (const string &errorMsg)
 
void reportInternalError (const string &errorMsg, const char *file, unsigned int lineNumber)
 
void reportSyntaxError (const Scanner &scanner, const string &errorMsg)
 
template<class Exception >
void throwError (const string &errorMsg)
 
 DEFINE_EXCEPTION (UnknownName)
 
 DEFINE_EXCEPTION (AmbiguousName)
 
 DEFINE_EXCEPTION (Unsupported)
 

Macro Definition Documentation

◆ DEFINE_EXCEPTION

#define DEFINE_EXCEPTION (   NAME)
Value:
class NAME##Exception : public FrobbyException { \
public: \
NAME##Exception(const string& str): FrobbyException(str) {} \
}
This is the base of the Frobby exception hierarchy for exceptions that can occur due to expected erro...
Definition: error.h:27

Definition at line 63 of file error.h.

◆ INTERNAL_ERROR

#define INTERNAL_ERROR (   msg)
Value:
do { \
reportInternalError(msg, __FILE__, __LINE__); \
throw; \
} while (false)

Definition at line 42 of file error.h.

◆ INTERNAL_ERROR_UNIMPLEMENTED

#define INTERNAL_ERROR_UNIMPLEMENTED ( )     INTERNAL_ERROR("Called function that has not been implemented.")

Definition at line 47 of file error.h.

Function Documentation

◆ DEFINE_EXCEPTION() [1/3]

DEFINE_EXCEPTION ( AmbiguousName  )

◆ DEFINE_EXCEPTION() [2/3]

DEFINE_EXCEPTION ( UnknownName  )

◆ DEFINE_EXCEPTION() [3/3]

DEFINE_EXCEPTION ( Unsupported  )

◆ reportError()

void reportError ( const string &  errorMsg)

Definition at line 23 of file error.cpp.

◆ reportInternalError() [1/2]

void reportInternalError ( const string &  errorMsg)

Definition at line 29 of file error.cpp.

◆ reportInternalError() [2/2]

void reportInternalError ( const string &  errorMsg,
const char *  file,
unsigned int  lineNumber 
)

Definition at line 35 of file error.cpp.

◆ reportSyntaxError()

void reportSyntaxError ( const Scanner scanner,
const string &  errorMsg 
)

Definition at line 44 of file error.cpp.

◆ throwError()

template<class Exception >
void throwError ( const string &  errorMsg)

Definition at line 58 of file error.h.