This is the exception thrown by most Mezzanine system that can throw exceptions. More...
#include <exception.h>
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... | |
ConstString & | GetExceptionTypeName () const throw () |
Gets the name of the exception type. More... | |
ConstString & | GetFile () const throw () |
Gets the file of the exception. More... | |
ConstString & | GetFunction () const throw () |
Gets the function of the exception. More... | |
const Whole & | GetLine () const throw () |
Gets the line number of the exception. More... | |
virtual String | what () throw () |
Retrieves the error message. More... | |
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.
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.
Mezzanine::Exception::Exception | ( | const String & | TypeName, |
const String & | Message, | ||
const String & | SrcFunction, | ||
const String & | SrcFile, | ||
const Whole & | FileLine | ||
) |
Simple Constructor.
TypeName | The name of the type of exception being thrown. |
Message | A basic description of the error. |
SrcFunction | The name of the function from which this originated. |
SrcFile | The name of the file from which this originated. |
FileLine | The 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.
String Mezzanine::Exception::GetCompleteMessage | ( | ) | const | |
throw | ( | |||
) |
Constructs the complete message from all the information provided about the exception.
Definition at line 97 of file exception.cpp.
|
pure virtual |
Gets 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.
Definition at line 77 of file exception.cpp.
ConstString & Mezzanine::Exception::GetFile | ( | ) | const | |
throw | ( | |||
) |
Gets the file of the exception.
Definition at line 87 of file exception.cpp.
ConstString & Mezzanine::Exception::GetFunction | ( | ) | const | |
throw | ( | |||
) |
Gets the function of the exception.
Definition at line 82 of file exception.cpp.
const Whole & Mezzanine::Exception::GetLine | ( | ) | const | |
throw | ( | |||
) |
Gets the line number of the exception.
Definition at line 92 of file exception.cpp.
|
virtual |
Retrieves the error message.
Definition at line 109 of file exception.cpp.