Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | List of all members
Mezzanine::ExceptionBase Class Referenceabstract

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

#include <exception.h>

+ Inheritance diagram for Mezzanine::ExceptionBase:
+ Collaboration diagram for Mezzanine::ExceptionBase:

Public Types

enum  ExceptionCodes {
  FIRST_EXCEPTION = 0x01F00F00, 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, LAST_EXCEPTION = 0x01F00F00
}
 This enum provides mapping/naming for all the core Mezzanine. More...
 

Public Member Functions

 ExceptionBase (const Mezzanine::String &TypeName, const Mezzanine::String &JavaTypeName, const Mezzanine::String &Message, const Mezzanine::String &SrcFunction, const Mezzanine::String &SrcFile, const Mezzanine::Whole &FileLine)
 Simple Constructor. More...
 
virtual ~ExceptionBase () throw ()
 Class destructor.
 
Mezzanine::String GetCompleteMessage () const throw ()
 Constructs the complete message from all the information provided about the exception. More...
 
virtual Mezzanine::Whole GetExceptionCode () const =0 throw ()
 Gets the exception code for this exception. More...
 
const Mezzanine::StringGetExceptionJavaTypeName () const throw ()
 Gets the name of the exception type. More...
 
const Mezzanine::StringGetExceptionTypeName () const throw ()
 Gets the name of the exception type. More...
 
const Mezzanine::StringGetFile () const throw ()
 Gets the file of the exception. More...
 
const Mezzanine::StringGetFunction () const throw ()
 Gets the function of the exception. More...
 
const Mezzanine::WholeGetLine () const throw ()
 Gets the line number of the exception. More...
 
virtual const char * what () const throw ()
 Retrieves the error message. More...
 

Detailed Description

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

Definition at line 59 of file exception.h.

Member Enumeration Documentation

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

This system might superficially look convoluted. It is designed to make capturing as much detail about problems as they occur.

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, using IO_EXCEPTION would make sense

Enumerator
FIRST_EXCEPTION 

To allow some inspection of the Exception system this can be use to identify the lower numbered Exception.

IO_EXCEPTION 

Thrown when there was an issue with IO but very little was known about it.

IO_FILE_EXCEPTION 

Thrown when there is an unknown issue with a file.

IO_FILE_READ_EXCEPTION 

Thrown when a file could not be read and permissions seem to not be an issue (Filesystem/hardware issue?

IO_FILE_WRITE_EXCEPTION 

Thrown when a file could not be written and perimssions seem not to be an issue.

IO_FILE_NOT_FOUND_EXCEPTION 

Thrown when a file was expected to be there, but was not.

IO_FILE_PERMISSION_EXCEPTION 

Thrown when permission was denied to a file.

IO_DIRECTORY_EXCEPTION 

Thrown when there is an unknown issue with a file.

IO_DIRECTORY_READ_EXCEPTION 

Thrown when a directory could be read and it wasn't a permission issue.

IO_DIRECTORY_WRITE_EXCEPTION 

Thrown when a directory could be written to and it wasn't a permission issue.

IO_DIRECTORY_NOT_FOUND_EXCEPTION 

Thrown when a directory was expected to be there, but was not.

IO_DIRECTORY_PERMISSION_EXCEPTION 

Thrown when permission is denied to a directory.

IO_NETWORK_EXCEPTION 

Thrown when something unknown causes network IO to fail.

IO_NETWORK_READ_EXCEPTION 

Thrown when data could not be read from the network (downloads)

IO_NETWORK_WRITE_EXCEPTION 

Thrown when data could not be read from the network (iloads)

IO_NETWORK_NOT_FOUND_EXCEPTION 

Thrown when no network connection is available.

IO_NETWORK_URL_EXCEPTION 

Thrown when an address is invalid or could not be found.

IO_NETWORK_PERMISSION_EXCEPTION 

Thrown when permision was denied to a network interface or network resource.

IO_WRITE_EXCEPTION 

Thrown when a write is happening but something has prevented the underlying code from knowing what was writing.

IO_READ_EXCEPTION 

Thrown when a read is happening but something has prevented the underlying code from knowing what was reading.

II_EXCEPTION 

Thrown when an unknown error with using an Identifier and it is invalid.

II_IDENTITY_INVALID_EXCEPTION 

Thrown when the identity string wasn't valid at all.

II_IDENTITY_NOT_FOUND_EXCEPTION 

Thrown when the requested identity could not be found.

II_DUPLICATE_IDENTITY_EXCEPTION 

Thrown when duplicates of teh same identity string exist.

MM_EXCEPTION 

Thrown when an unknown memory management exception occurs.

MM_OUT_OF_MEMORY_EXCEPTION 

Thrown when A memory allocation was attempted and failed.

MM_OUT_OF_BOUNDS_EXCEPTION 

Thrown when attempted to access something that really should note be accessed.

SYNTAX_ERROR_EXCEPTION 

Thrown when some kind of syntax exception.

SYNTAX_ERROR_EXCEPTION_XML 

Thrown when and XML document is being parsed but is invalid.

SYNTAX_ERROR_EXCEPTION_XPATH 

Thrown when an XPath query is being parsed but is invalid.

SYNTAX_ERROR_EXCEPTION_LUA 

Thrown when lua code in incorrect.

SCRIPT_EXCEPTION 

Thrown when an unknown error happens with a script.

SCRIPT_EXCEPTION_LUA 

Thrown when an unknown error happens in a Lua script.

SCRIPT_EXCEPTION_LUA_YIELD 

Thrown when Lua returns a yield and it should not have.

SCRIPT_EXCEPTION_LUA_RUNTIME 

Thrown when a Lua script has a runtime error.

SCRIPT_EXCEPTION_LUA_ERRERR 

Thrown when Lua has an error handling an error.

PARAMETERS_EXCEPTION 

Thrown when parameters are checked at runtime and found invalid.

PARAMETERS_CAST_EXCEPTION 

Thrown when a pointer parameter is checked at runtime and cannot be cast as expected.

PARAMETERS_RANGE_EXCEPTION 

Thrown when a passed parameter is checked at runtime and not in the expected range.

ARITHMETIC_EXCEPTION 

Thrown when Math has failed.

INVALID_VERSION_EXCEPTION 

Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing.

INVALID_STATE_EXCEPTION 

Thrown when the available information should have worked but failed for unknown reasons.

RENDERINGAPI_EXCEPTION 

Thrown when the graphics card/DirectX/OpenGL fail.

RT_ASSERTION_EXCEPTION 

Thrown when a rutime assertion could have been Thrown.

INTERNAL_EXCEPTION 

Thrown when an unknown internal error occurred.

NOT_IMPLEMENTED_EXCEPTION 

Thrown when we just have not coded a thing yet, but we knew what the API should look like.

INVALID_ASSIGNMENT 

Thrown when a complex class is assigned to itself or other invalid assignments occur.

LAST_EXCEPTION 

To allow some inspection of the Exception system this can be use to identify the highest numbered Exception.

Definition at line 70 of file exception.h.

Constructor & Destructor Documentation

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

Simple Constructor.

Parameters
TypeNameThe name of the type of exception being thrown.
JavaTypeNameWhat Java exception Corresponds to this?
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. This constructor might change with time to include more data.

Definition at line 54 of file exception.cpp.

Member Function Documentation

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

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

Returns
Returns a Mezzanine::String with the complete error.

Definition at line 96 of file exception.cpp.

virtual Mezzanine::Whole Mezzanine::ExceptionBase::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::ExceptionBase::GetExceptionJavaTypeName ( ) const
throw (
)

Gets the name of the exception type.

Returns
Returns the exception type as a Mezzanine::String.

Definition at line 84 of file exception.cpp.

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

Gets the name of the exception type.

Returns
Returns the exception type as a Mezzanine::String.

Definition at line 81 of file exception.cpp.

ConstString & Mezzanine::ExceptionBase::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 90 of file exception.cpp.

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

Gets the function of the exception.

Returns
Returns a const Mezzanine::String reference

Definition at line 87 of file exception.cpp.

const Whole & Mezzanine::ExceptionBase::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 93 of file exception.cpp.

const char * Mezzanine::ExceptionBase::what ( ) const
throw (
)
virtual

Retrieves the error message.

Returns
This returns a Mezzanine::String that is the stored error message.

Definition at line 113 of file exception.cpp.


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