OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
When thrown, provides information about an error that has occurred inside the engine. More...
#include <OgreException.h>
Public Types | |
enum | ExceptionCodes { ERR_CANNOT_WRITE_TO_FILE , ERR_INVALID_STATE , ERR_INVALIDPARAMS , ERR_RENDERINGAPI_ERROR , ERR_DUPLICATE_ITEM , ERR_ITEM_NOT_FOUND = ERR_DUPLICATE_ITEM , ERR_FILE_NOT_FOUND , ERR_INTERNAL_ERROR , ERR_RT_ASSERTION_FAILED , ERR_NOT_IMPLEMENTED , ERR_INVALID_CALL } |
Static definitions of error codes. More... | |
Public Member Functions | |
Exception (const Exception &rhs) | |
Copy constructor. | |
Exception (int number, const String &description, const String &source) | |
Default constructor. | |
Exception (int number, const String &description, const String &source, const char *type, const char *file, long line) | |
Advanced constructor. | |
~Exception () throw () | |
Needed for compatibility with std::exception. | |
const String & | getDescription (void) const |
Returns a string with only the 'description' field of this exception. | |
const char * | getFile () const |
Gets source file name. | |
const String & | getFullDescription (void) const |
Returns a string with the full description of this error. | |
long | getLine () const |
Gets line number. | |
const String & | getSource () const |
Gets the source function. | |
const char * | what () const override throw () |
When thrown, provides information about an error that has occurred inside the engine.
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.
Default constructor.
Ogre::Exception::Exception | ( | int | number, |
const String & | description, | ||
const String & | source, | ||
const char * | type, | ||
const char * | file, | ||
long | line | ||
) |
Advanced constructor.
|
inline |
Needed for compatibility with std::exception.
Returns a string with the full description of this error.
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.
|
inline |
Gets line number.
Returns a string with only the 'description' field of this exception.
Use getFullDescriptionto get a full description of the error including line number, error number and what function threw the exception.