Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Exception Class Reference

When thrown, provides information about an error that has occurred inside the engine. More...

#include <OgreException.h>

List of all members.

Public Types

enum  ExceptionCodes {
  UNIMPLEMENTED_FEATURE, ERR_CANNOT_WRITE_TO_FILE, ERR_NO_RENDERSYSTEM_SELECTED, ERR_DIALOG_OPEN_ERROR,
  ERR_INVALIDPARAMS, ERR_RENDERINGAPI_ERROR, ERR_DUPLICATE_ITEM, ERR_ITEM_NOT_FOUND,
  ERR_FILE_NOT_FOUND, ERR_INTERNAL_ERROR, ERR_RT_ASSERTION_FAILED
}
 Static definitions of error codes. More...


Public Methods

 Exception (int number, const String &description, const String &source)
 Default constructor. More...

 Exception (int number, const String &description, const String &source, char *file, long line)
 Advanced constructor. More...

 Exception (const Exception &rhs)
 Copy constructor. More...

void operator= (const Exception &rhs)
 Assignment operator. More...

String getFullDescription (void) const
 Returns a string with the full description of this error. More...

int getNumber (void) throw ()
 Gets the error code. More...


Static Public Methods

Exception * getLastException (void) throw ()
 Retrieves a pointer to the last exception created. More...

void _pushFunction (const String &strFuncName) throw ()
 Pushes a function on the stack. More...

void _popFunction () throw ()
 Pops a function from the stack. More...


Protected Attributes

long line
int number
String description
String source
String file

Static Protected Attributes

Exception * last = NULL
OgreChar msFunctionStack [OGRE_CALL_STACK_DEPTH][256]
ushort msStackDepth = 0


Detailed Description

When thrown, provides information about an error that has occurred inside the engine.

Remarks:
OGRE never uses return values to indicate errors. Instead, if an error occurs, an exception is thrown, and this is the object that encapsulates the detail of the problem. The application using OGRE should always ensure that the exceptions are caught, so all OGRE engine functions should occur within a try{} catch(Ogre::Exception& e) {} block.

The user application should never create any instances of this object unless it wishes to unify its error handling using the same object.


Member Enumeration Documentation

enum Ogre::Exception::ExceptionCodes
 

Static definitions of error codes.

Todo:
Add many more exception codes, since we want the user to be able to catch most of them.
Enumeration values:
UNIMPLEMENTED_FEATURE 
ERR_CANNOT_WRITE_TO_FILE 
ERR_NO_RENDERSYSTEM_SELECTED 
ERR_DIALOG_OPEN_ERROR 
ERR_INVALIDPARAMS 
ERR_RENDERINGAPI_ERROR 
ERR_DUPLICATE_ITEM 
ERR_ITEM_NOT_FOUND 
ERR_FILE_NOT_FOUND 
ERR_INTERNAL_ERROR 
ERR_RT_ASSERTION_FAILED 


Constructor & Destructor Documentation

Ogre::Exception::Exception int    number,
const String   description,
const String   source
 

Default constructor.

Ogre::Exception::Exception int    number,
const String   description,
const String   source,
char *    file,
long    line
 

Advanced constructor.

Ogre::Exception::Exception const Exception &    rhs
 

Copy constructor.


Member Function Documentation

void Ogre::Exception::_popFunction   throw () [static]
 

Pops a function from the stack.

void Ogre::Exception::_pushFunction const String   strFuncName throw () [static]
 

Pushes a function on the stack.

String Ogre::Exception::getFullDescription void    const
 

Returns a string with the full description of this error.

Remarks:
The description contains the error number, the description supplied by the thrower, what routine threw the exception, and will also supply extra platform-specific information where applicable. For example - in the case of a rendering library error, the description of the error will include both the place in which OGRE found the problem, and a text description from the 3D rendering library, if available.

Exception * Ogre::Exception::getLastException void    throw () [static]
 

Retrieves a pointer to the last exception created.

int Ogre::Exception::getNumber void    throw ()
 

Gets the error code.

void Ogre::Exception::operator= const Exception &    rhs
 

Assignment operator.


Member Data Documentation

String Ogre::Exception::description [protected]
 

String Ogre::Exception::file [protected]
 

Exception * Ogre::Exception::last = NULL [static, protected]
 

long Ogre::Exception::line [protected]
 

OgreChar Ogre::Exception::msFunctionStack [static, protected]
 

ushort Ogre::Exception::msStackDepth = 0 [static, protected]
 

int Ogre::Exception::number [protected]
 

String Ogre::Exception::source [protected]
 

Copyright © 2002 by The OGRE Team