MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
Mezzanine::Exception Class Referenceabstract

This is the exception thrown by most Mezzanine system that can throw exceptions. More...

#include <exception.h>

+ Inheritance diagram for Mezzanine::Exception:
+ Collaboration diagram for Mezzanine::Exception:

Public Types

enum  ExceptionCodes {
  IO_EXCEPTION = 0x01F00F00, IO_FILE_EXCEPTION = 0x01F01F00, IO_FILE_READ_EXCEPTION = 0x01F01F01, IO_FILE_WRITE_EXCEPTION = 0x01F01F02,
  IO_FILE_NOT_FOUND_EXCEPTION = 0x01F01F03, IO_FILE_PERMISSION_EXCEPTION = 0x01F01F04, IO_DIRECTORY_EXCEPTION = 0x01F02F00, IO_DIRECTORY_READ_EXCEPTION = 0x01F02F01,
  IO_DIRECTORY_WRITE_EXCEPTION = 0x01F02F02, IO_DIRECTORY_NOT_FOUND_EXCEPTION = 0x01F02F03, IO_DIRECTORY_PERMISSION_EXCEPTION = 0x01F02F04, IO_NETWORK_EXCEPTION = 0x01F03F00,
  IO_NETWORK_READ_EXCEPTION = 0x01F03F01, IO_NETWORK_WRITE_EXCEPTION = 0x01F03F02, IO_NETWORK_NOT_FOUND_EXCEPTION = 0x01F03F03, IO_NETWORK_URL_EXCEPTION = 0x01F03F04,
  IO_NETWORK_PERMISSION_EXCEPTION = 0x01F03F05, IO_WRITE_EXCEPTION = 0x01F08F00, IO_READ_EXCEPTION = 0x01F09F00, II_EXCEPTION = 0x02F00F00,
  II_IDENTITY_INVALID_EXCEPTION = 0x02F01F00, II_IDENTITY_NOT_FOUND_EXCEPTION = 0x02F02F00, II_DUPLICATE_IDENTITY_EXCEPTION = 0x02F03F00, MM_EXCEPTION = 0x03F00F00,
  MM_OUT_OF_MEMORY_EXCEPTION = 0x03F01F00, MM_OUT_OF_BOUNDS_EXCEPTION = 0x03F02F00, SYNTAX_ERROR_EXCEPTION = 0x04F00F00, SYNTAX_ERROR_EXCEPTION_XML = 0x04F01F00,
  SYNTAX_ERROR_EXCEPTION_XPATH = 0x04F02F00, SYNTAX_ERROR_EXCEPTION_LUA = 0x04F03F00, SCRIPT_EXCEPTION = 0x05F00F00, SCRIPT_EXCEPTION_LUA = 0x05F01F00,
  SCRIPT_EXCEPTION_LUA_YIELD = 0x05F01F01, SCRIPT_EXCEPTION_LUA_RUNTIME = 0x05F01F02, SCRIPT_EXCEPTION_LUA_ERRERR = 0x05F01F03, PARAMETERS_EXCEPTION = 0x06F01F00,
  PARAMETERS_CAST_EXCEPTION = 0x06F01F01, PARAMETERS_RANGE_EXCEPTION = 0x06F01F02, ARITHMETIC_EXCEPTION = 0x00F01F00, INVALID_VERSION_EXCEPTION = 0x00F02F00,
  INVALID_STATE_EXCEPTION = 0x00F03F00, RENDERINGAPI_EXCEPTION = 0x00F04F00, RT_ASSERTION_EXCEPTION = 0x00F05F00, INTERNAL_EXCEPTION = 0x00F06F00,
  NOT_IMPLEMENTED_EXCEPTION = 0x00F07F00, INVALID_ASSIGNMENT = 0x00F08F00
}
 This enum provides mapping/naming for all the core exceptions of Mezzanine. More...
 

Public Member Functions

 Exception (const String &TypeName, const String &Message, const String &SrcFunction, const String &SrcFile, const Whole &FileLine)
 Simple Constructor. More...
 
virtual ~Exception () throw ()
 Class destructor.
 
String GetCompleteMessage () const throw ()
 Constructs the complete message from all the information provided about the exception. More...
 
virtual Whole GetExceptionCode () const =0 throw ()
 Gets the exception code for this exception. More...
 
ConstStringGetExceptionTypeName () const throw ()
 Gets the name of the exception type. More...
 
ConstStringGetFile () const throw ()
 Gets the file of the exception. More...
 
ConstStringGetFunction () const throw ()
 Gets the function of the exception. More...
 
const WholeGetLine () const throw ()
 Gets the line number of the exception. More...
 
virtual String what () throw ()
 Retrieves the error message. More...
 

Detailed Description

This is the exception thrown by most Mezzanine system that can throw exceptions.

In general they work like std::exception, but construct a string message from a few source with the help of a macro.

Definition at line 59 of file exception.h.

Member Enumeration Documentation

This enum provides mapping/naming for all the core exceptions of Mezzanine.

The numbers listed here must be unique to each exception. If an error code does not identify the problem exactly it should be considered 'Unknown' for as much as it does specify. For example, if there is an error opening a file for reading and writing, and we don't know why it failed, useing IO_EXCEPTION would make sense

Enumerator
IO_EXCEPTION 

When used a instance of IOException is thrown. Thrown when there was an issue with IO but very little was known about it.

IO_FILE_EXCEPTION 

When used a instance of FileException is thrown. Thrown when there is an unknown issue with a file.

IO_FILE_READ_EXCEPTION 

When used a instance of FileReadException is thrown. Thrown when a file could not be read and permissions seem to not be an issue (Filesystem/hardware issue?)

IO_FILE_WRITE_EXCEPTION 

When used a instance of FileWriteException is thrown. Thrown when a file could not be written and perimssions seem not to be an issue.

IO_FILE_NOT_FOUND_EXCEPTION 

When used a instance of FileNotFoundException is thrown. Thrown when a file was expected to be there, but was not.

IO_FILE_PERMISSION_EXCEPTION 

When used a instance of FilePermissionException is thrown. Thrown when permission was denied to a file.

IO_DIRECTORY_EXCEPTION 

When used a instance of DirectoryException is thrown. Thrown when there is an unknown issue with a file.

IO_DIRECTORY_READ_EXCEPTION 

When used a instance of DirectoryReadException is thrown. Thrown when a directory could be read and it wasn't a permission issue.

IO_DIRECTORY_WRITE_EXCEPTION 

When used a instance of DirectoryWriteException is thrown. Thrown when a directory could be written to and it wasn't a permission issue.

IO_DIRECTORY_NOT_FOUND_EXCEPTION 

When used a instance of DirectoryNotFoundException is thrown. Thrown when a directory was expected to be there, but was not.

IO_DIRECTORY_PERMISSION_EXCEPTION 

When used a instance of DirectoryPermissionException is thrown. Thrown when permission is denied to a directory.

IO_NETWORK_EXCEPTION 

When used a instance of NetworkException is thrown. Thrown when something unknown causes network IO to fail.

IO_NETWORK_READ_EXCEPTION 

When used a instance of NetworkReadException is thrown. Thrown when data could not be read from the network (downloads).

IO_NETWORK_WRITE_EXCEPTION 

When used a instance of NetworkWriteException is thrown. Thrown when data could not be read from the network (iloads).

IO_NETWORK_NOT_FOUND_EXCEPTION 

When used a instance of NetworkNotFoundException is thrown. Thrown when no network connection is available.

IO_NETWORK_URL_EXCEPTION 

When used a instance of NetworkURLException is thrown. Thrown when an address is invalid or could not be found.

IO_NETWORK_PERMISSION_EXCEPTION 

When used a instance of NetworkPermissionException is thrown. Thrown when permision was denied to a network interface or network resource.

IO_WRITE_EXCEPTION 

When used a instance of IOWriteException is thrown. Thrown when a write is happening but something has prevented the underlying code from knowing what was writing.

IO_READ_EXCEPTION 

When used a instance of IOReadException is thrown. Thrown when a read is happening but something has prevented the underlying code from knowing what was reading.

II_EXCEPTION 

When used a instance of InstanceIdentityException is thrown. Thrown when an unknown error with using an Identifier and it is invalid.

II_IDENTITY_INVALID_EXCEPTION 

When used a instance of InstanceIdentityInvalidException is thrown. Thrown when the identity string wasn't valid at all.

II_IDENTITY_NOT_FOUND_EXCEPTION 

When used a instance of InstanceIdentityNotFoundException is thrown. Thrown when the requested identity could not be found.

II_DUPLICATE_IDENTITY_EXCEPTION 

When used a instance of InstanceIdentityDuplicateException is thrown. Thrown when duplicates of teh same identity string exist.

MM_EXCEPTION 

When used a instance of MemoryManagementException is thrown. Thrown when an unknown memory management exception occurs.

MM_OUT_OF_MEMORY_EXCEPTION 

When used a instance of OutOfMemoryException is thrown. Thrown when A memory allocation was attempted and failed.

MM_OUT_OF_BOUNDS_EXCEPTION 

When used a instance of MemoryOutOfBoundsException is thrown. Thrown when attempted to access something that really should note be accessed.

SYNTAX_ERROR_EXCEPTION 

When used a instance of SyntaxErrorException is thrown. Thrown when some kind of syntax exception.

SYNTAX_ERROR_EXCEPTION_XML 

When used a instance of SyntaxErrorXMLException is thrown. Thrown when and XML document is being parsed but is invalid.

SYNTAX_ERROR_EXCEPTION_XPATH 

When used a instance of SyntaxErrorXPathException is thrown. Thrown when an XPath query is being parsed but is invalid.

SYNTAX_ERROR_EXCEPTION_LUA 

When used a instance of SyntaxErrorLuaException is thrown. Thrown when lua code in incorrect.

SCRIPT_EXCEPTION 

When used a instance of ScriptException is thrown. Thrown when an unknown error happens with a script.

SCRIPT_EXCEPTION_LUA 

When used a instance of ScriptLuaException is thrown. Thrown when an unknown error happens in a Lua script.

SCRIPT_EXCEPTION_LUA_YIELD 

When used a instance of ScriptLuaYieldException is thrown. Thrown when Lua returns a yield and it should not have.

SCRIPT_EXCEPTION_LUA_RUNTIME 

When used a instance of ScriptLuaRuntimeException is thrown. Thrown when a Lua script has a runtime error.

SCRIPT_EXCEPTION_LUA_ERRERR 

When used a instance of ScriptLuaErrErrException is thrown. Thrown when Lua has an error handling an error.

PARAMETERS_EXCEPTION 

When used a instance of ParametersException is thrown. Thrown when parameters are checked at runtime and found invalid.

PARAMETERS_CAST_EXCEPTION 

When used a instance of ParametersCastException is thrown. Thrown when a pointer parameter is checked at runtime and cannot be cast as expected.

PARAMETERS_RANGE_EXCEPTION 

When used a instance of ParametersRangeException is thrown. Thrown when a passed parameter is checked at runtime and not in the expected range.

ARITHMETIC_EXCEPTION 

When used a instance of ArithmeticException is thrown. Thrown when Math has failed.

INVALID_VERSION_EXCEPTION 

When used a instance of InvalidVersionException is thrown. Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing.

INVALID_STATE_EXCEPTION 

When used a instance of InvalidStateException is thrown. Thrown when the available information should have worked but failed for unknown reasons.

RENDERINGAPI_EXCEPTION 

When used a instance of RenderingAPIException is thrown. Thrown when the graphics card/DirectX/OpenGL fail.

RT_ASSERTION_EXCEPTION 

When used a instance of RuntimeAssertionException is thrown. Thrown when a rutime assertion could have been thrown.

INTERNAL_EXCEPTION 

When used a instance of InternalException is thrown. Thrown when an unknown internal error occurred.

NOT_IMPLEMENTED_EXCEPTION 

When used a instance of NotImplementedException is thrown. Thrown when we just have not coded a thing yet, but we knew what the API should look like.

INVALID_ASSIGNMENT 

When used a instance of InvalidAssignment is thrown. Then when a complex class is assigned to itself or other invalid assignments occur.

Definition at line 68 of file exception.h.

Constructor & Destructor Documentation

Mezzanine::Exception::Exception ( const String TypeName,
const String Message,
const String SrcFunction,
const String SrcFile,
const Whole FileLine 
)

Simple Constructor.

Parameters
TypeNameThe name of the type of exception being thrown.
MessageA basic description of the error.
SrcFunctionThe name of the function from which this originated.
SrcFileThe name of the file from which this originated.
FileLineThe line on the named file from which this originated.

Don't call this, use MEZZ_EXCEPTION to throw these, it is much simpler. It also might get better with time.

Definition at line 54 of file exception.cpp.

Member Function Documentation

String Mezzanine::Exception::GetCompleteMessage ( ) const
throw (
)

Constructs the complete message from all the information provided about the exception.

Returns
Returns a string with the complete error.

Definition at line 97 of file exception.cpp.

virtual Whole Mezzanine::Exception::GetExceptionCode ( ) const
throw (
)
pure virtual

Gets the exception code for this exception.

Returns
Returns the exception code for this exception.

Implemented in Mezzanine::InvalidAssignment, Mezzanine::NotImplementedException, Mezzanine::InternalException, Mezzanine::RuntimeAssertionException, Mezzanine::RenderingAPIException, Mezzanine::InvalidStateException, Mezzanine::InvalidVersionException, Mezzanine::ArithmeticException, Mezzanine::ParametersRangeException, Mezzanine::ParametersCastException, Mezzanine::ParametersException, Mezzanine::ScriptLuaErrErrException, Mezzanine::ScriptLuaRuntimeException, Mezzanine::ScriptLuaYieldException, Mezzanine::ScriptLuaException, Mezzanine::ScriptException, Mezzanine::SyntaxErrorLuaException, Mezzanine::SyntaxErrorXPathException, Mezzanine::SyntaxErrorXMLException, Mezzanine::SyntaxErrorException, Mezzanine::MemoryOutOfBoundsException, Mezzanine::OutOfMemoryException, Mezzanine::MemoryManagementException, Mezzanine::InstanceIdentityDuplicateException, Mezzanine::InstanceIdentityNotFoundException, Mezzanine::InstanceIdentityInvalidException, Mezzanine::InstanceIdentityException, Mezzanine::IOReadException, Mezzanine::IOWriteException, Mezzanine::NetworkPermissionException, Mezzanine::NetworkURLException, Mezzanine::NetworkNotFoundException, Mezzanine::NetworkWriteException, Mezzanine::NetworkReadException, Mezzanine::NetworkException, Mezzanine::DirectoryPermissionException, Mezzanine::DirectoryNotFoundException, Mezzanine::DirectoryWriteException, Mezzanine::DirectoryReadException, Mezzanine::DirectoryException, Mezzanine::FilePermissionException, Mezzanine::FileNotFoundException, Mezzanine::FileWriteException, Mezzanine::FileReadException, Mezzanine::FileException, and Mezzanine::IOException.

ConstString & Mezzanine::Exception::GetExceptionTypeName ( ) const
throw (
)

Gets the name of the exception type.

Returns
Returns the exception type as a string.

Definition at line 77 of file exception.cpp.

ConstString & Mezzanine::Exception::GetFile ( ) const
throw (
)

Gets the file of the exception.

Returns
Returns the name of the file this exception is being thrown from.

Definition at line 87 of file exception.cpp.

ConstString & Mezzanine::Exception::GetFunction ( ) const
throw (
)

Gets the function of the exception.

Returns
Returns a const string reference

Definition at line 82 of file exception.cpp.

const Whole & Mezzanine::Exception::GetLine ( ) const
throw (
)

Gets the line number of the exception.

Returns
Returns the line in the file this exception is being thrown from.

Definition at line 92 of file exception.cpp.

String Mezzanine::Exception::what ( )
throw (
)
virtual

Retrieves the error message.

Returns
This returns a string that is the stored error message.

Definition at line 109 of file exception.cpp.


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