Exception & Errors


Data Structures

class  nrEngine::Exception
 Exception thrown by the engine if any non returnable error occurs. More...

Defines

#define NR_EXCEPT(num, desc, src)   throw( ::nrEngine::Exception( num, desc, src, __FILE__, __LINE__ ) )
#define NR_ASSERT(exp)   ::nrEngine::Exception::Assert(exp, #exp, __FILE__, "" , __LINE__ )

Typedefs

typedef uint32 nrEngine::Result
 The result code is only an integer in real.

Enumerations

enum  nrEngine::ResultCode {
  nrEngine::OK = 0,
  nrEngine::UNKNOWN_ERROR = 0xFFFFFFFF,
  nrEngine::BAD_PARAMETERS = 1 << 0,
  nrEngine::OUT_OF_MEMORY = 1 << 1,
  nrEngine::NOT_VALID_DATOR = 1 << 2,
  nrEngine::TIME_OUT = 1 << 3,
  nrEngine::FILE_ERROR = NR_ERR_GROUP(2),
  nrEngine::FILE_NOT_FOUND = FILE_ERROR | (1 << 0),
  nrEngine::FILE_ERROR_IN_LINE = FILE_ERROR | (1 << 1),
  nrEngine::PROFILE_ERROR = NR_ERR_GROUP(3),
  nrEngine::PROFILE_NOT_FOUND = PROFILE_ERROR | (1 << 0),
  nrEngine::PROFILE_NOT_LOADED = PROFILE_ERROR | (1 << 1),
  nrEngine::PROFILE_NOT_EXISTS = PROFILE_ERROR | (1 << 2),
  nrEngine::PROFILE_ALREADY_EXISTS = PROFILE_ERROR | (1 << 3),
  nrEngine::VFS_ERROR = NR_ERR_GROUP(4),
  nrEngine::VFS_ALREADY_OPEN = VFS_ERROR | (1 << 0),
  nrEngine::VFS_CANNOT_OPEN = VFS_ERROR | (1 << 1),
  nrEngine::VFS_CANNOT_CLOSE = VFS_ERROR | (1 << 2),
  nrEngine::VFS_IS_NOT_OPEN = VFS_ERROR | (1 << 3),
  nrEngine::VFS_FILE_NOT_FOUND = VFS_ERROR | (1 << 4),
  nrEngine::VFS_FILE_NOT_OPEN = VFS_ERROR | (1 << 5),
  nrEngine::VFS_FILE_END_REACHED = VFS_ERROR | (1 << 6),
  nrEngine::VFS_FILE_READ_ERROR = VFS_ERROR | (1 << 7),
  nrEngine::VFS_LINE_READ_ERROR = VFS_ERROR | (1 << 8),
  nrEngine::VFS_SCAN_READ_ERROR = VFS_ERROR | (1 << 9),
  nrEngine::VFS_SEEK_ERROR = VFS_ERROR | (1 << 10),
  nrEngine::VFS_NO_PARAMETER = VFS_ERROR | (1 << 11),
  nrEngine::SETTINGS_ERROR = NR_ERR_GROUP(5),
  nrEngine::SETTINGS_VAR_ALREADY_REGISTERED = SETTINGS_ERROR | (1 << 1),
  nrEngine::SETTINGS_VAR_NOT_REGISTERED = SETTINGS_ERROR | (1 << 2),
  nrEngine::KERNEL_ERROR = NR_ERR_GROUP(6),
  nrEngine::KERNEL_NO_TASK_FOUND = KERNEL_ERROR | (1 << 1),
  nrEngine::KERNEL_NO_RIGHTS = KERNEL_ERROR | (1 << 2),
  nrEngine::KERNEL_TASK_NOT_READY = KERNEL_ERROR | (1 << 3),
  nrEngine::KERNEL_CIRCULAR_DEPENDENCY = KERNEL_ERROR | (1 << 4),
  nrEngine::KERNEL_TASK_MISSING = KERNEL_ERROR | (1 << 5),
  nrEngine::KERNEL_END_REACHED = KERNEL_ERROR | (1 << 6),
  nrEngine::KERNEL_ALREADY_VISITED = KERNEL_ERROR | (1 << 7),
  nrEngine::KERNEL_LEAF_TASK = KERNEL_ERROR | (1 << 8),
  nrEngine::CLOCK_ERROR = NR_ERR_GROUP(7),
  nrEngine::CLOCK_OBSERVER_NOT_FOUND = CLOCK_ERROR | (1 << 1),
  nrEngine::CLOCK_OBSERVER_ALREADY_ADDED = CLOCK_ERROR | (1 << 2),
  nrEngine::CLOCK_NO_TIME_SOURCE = CLOCK_ERROR | (1 << 3),
  nrEngine::FW_ERROR = NR_ERR_GROUP (8),
  nrEngine::FW_CANNOT_INITIALIZE = FW_ERROR | (1 << 1),
  nrEngine::FW_FAILED_TO_RESIZE = FW_ERROR | (1 << 2),
  nrEngine::FW_INVALID_RC_ID = FW_ERROR | (1 << 3),
  nrEngine::FW_ALREADY_INIT = FW_ERROR | (1 << 4),
  nrEngine::FW_NOT_INITIALIZED = FW_ERROR | (1 << 5),
  nrEngine::FW_RC_CANNOT_SETUP_PIXEL_FORMAT = FW_ERROR | (1 << 6),
  nrEngine::RES_ERROR = NR_ERR_GROUP(9),
  nrEngine::RES_LOADER_ALREADY_EXISTS = RES_ERROR | (1 << 1),
  nrEngine::RES_LOADER_NOT_REGISTERED = RES_ERROR | (1 << 2),
  nrEngine::RES_ALREADY_EXISTS = RES_ERROR | (1 << 3),
  nrEngine::RES_BAD_FILETYPE = RES_ERROR | (1 << 4),
  nrEngine::RES_CAN_NOT_LOAD_EMPTY = RES_ERROR | (1 << 5),
  nrEngine::RES_NOT_FOUND = RES_ERROR | (1 << 6),
  nrEngine::RES_LOADER_NOT_EXISTS = RES_ERROR | (1 << 7),
  nrEngine::RES_IS_EMPTY = RES_ERROR | (1 << 8),
  nrEngine::RES_GROUP_NOT_FOUND = RES_ERROR | (1 << 9),
  nrEngine::RES_PTR_IS_NULL = RES_ERROR | (1 << 10),
  nrEngine::RES_TYPE_NOT_SUPPORTED = RES_ERROR | (1 << 11),
  nrEngine::RES_LOCK_STATE_STACK_IS_FULL = RES_ERROR | (1 << 12),
  nrEngine::RES_NO_EMPTY_RES_FOUND = RES_ERROR | (1 << 13),
  nrEngine::PLG_ERROR = NR_ERR_GROUP(10),
  nrEngine::PLG_COULD_NOT_LOAD = PLG_ERROR | (1 << 0),
  nrEngine::PLG_CANNOT_INITIALIZE = PLG_ERROR | (1 << 1),
  nrEngine::PLG_EXTERNAL_ERROR = PLG_ERROR | (1 << 2),
  nrEngine::PLG_SYMBOL_NOT_FOUND = PLG_ERROR | (1 << 3),
  nrEngine::PLG_WRONG_VERSION = PLG_ERROR | (1 << 4),
  nrEngine::PLG_UNLOAD_ERROR = PLG_ERROR | (1 << 5),
  nrEngine::SCRIPT_ERROR = NR_ERR_GROUP(11),
  nrEngine::SCRIPT_PARSE_ERROR = SCRIPT_ERROR | (1 << 0),
  nrEngine::SCRIPT_FUNCTION_REGISTERED = SCRIPT_ERROR | (1 << 1),
  nrEngine::SCRIPT_FUNCTION_NOT_REGISTERED = SCRIPT_ERROR | (1 << 2),
  nrEngine::SCRIPT_FUNCTION_NOT_FOUND = SCRIPT_ERROR | (1 << 3),
  nrEngine::SCRIPT_WRONG_PARAMETER_VALUE = SCRIPT_ERROR | (1 << 4),
  nrEngine::SCRIPT_ALREADY_RUNNING = SCRIPT_ERROR | (1 << 5),
  nrEngine::EVENT_ERROR = NR_ERR_GROUP(12),
  nrEngine::EVENT_CHANNEL_EXISTS = EVENT_ERROR | (1 << 0),
  nrEngine::EVENT_NO_CHANNEL_FOUND = EVENT_ERROR | (1 << 1),
  nrEngine::EVENT_ALREADY_CONNECTED = EVENT_ERROR | (1 << 2),
  nrEngine::EVENT_NOT_CONNECTED = EVENT_ERROR | (1 << 3),
  nrEngine::EVENT_CHANNEL_NOT_EXISTS = EVENT_ERROR | (1 << 4),
  nrEngine::EVENT_COULD_NOT_CAST = EVENT_ERROR | (1 << 5),
  nrEngine::EVENT_FACTORY_FOUND = EVENT_ERROR | (1 << 6),
  nrEngine::EVENT_FACTORY_NOT_FOUND = EVENT_ERROR | (1 << 7),
  nrEngine::EVENT_NO_VALID_ACTOR = EVENT_ERROR | (1 << 8),
  nrEngine::PROPERTY_ERROR = NR_ERR_GROUP(13),
  nrEngine::PROPERTY_NOT_EXISTS = PROPERTY_ERROR | (1 << 0),
  nrEngine::PROPERTY_WRONG_TYPE = PROPERTY_ERROR | (1 << 1),
  nrEngine::ENGINE_ERROR = NR_ERR_GROUP(127)
}

Detailed Description

In every application as in our engine there will be some exceptions and errors that should be managed. Our engine does use return codes to define if any exception occurs. This is used for performance and coding style reasons. So here you can find the definition adn description of the error codes that could be given back by a function.
But sometimes engine can not return an error code back (i.e. if error occurs in a constructor). In this case an exception will be thrown. Each exception is of the Exception - class.

Define Documentation

#define NR_ASSERT ( exp   )     ::nrEngine::Exception::Assert(exp, #exp, __FILE__, "" , __LINE__ )

Assertion definition used in the engine. This assertion will produce more readable text.

Definition at line 33 of file Exception.h.

Referenced by nrEngine::Profiler::beginProfile(), nrEngine::ResourceManager::createResource(), nrEngine::Profiler::endProfile(), nrEngine::IResourcePtr::getBase(), nrEngine::ScriptEngine::getFunction(), nrEngine::ResourceManager::loadResource(), nrEngine::ResourcePtr< ResType >::operator->(), nrEngine::VarArg::pop_back(), and nrEngine::VarArg::pop_front().

#define NR_EXCEPT ( num,
desc,
src   )     throw( ::nrEngine::Exception( num, desc, src, __FILE__, __LINE__ ) )

This is a macro which throw an exception object

Definition at line 27 of file Exception.h.

Referenced by nrEngine::IScript::call(), nrEngine::PropertyManager::get(), nrEngine::PropertyManager::getByFullName(), and nrEngine::PropertyList::operator[]().


Enumeration Type Documentation

enum nrEngine::ResultCode

nrEngine's error codes returned back by some functions.
You can combine error codes of different groups in binary manner (e.g. BAD_PARAMETERS | OUT_OF_MEMORY).

Enumerator:
OK  Don't worry, no error occurs. That is fine :-).
UNKNOWN_ERROR  Will be given back if the engine can not detect what kind of error does occurs.
BAD_PARAMETERS  The parameters given to the function are not valid.
OUT_OF_MEMORY  Engine couldn't allocate a block of memory because (prob.) no memory available.
NOT_VALID_DATOR  The dator does not contain valid data.
TIME_OUT  Generic time out error.
FILE_ERROR  This is a general "group error" produced by work on the files.
FILE_NOT_FOUND  If file was not found, so this error will be given back.
FILE_ERROR_IN_LINE  If file has got errors by reading out of a line.
PROFILE_ERROR  General error of the profile error group.
PROFILE_NOT_FOUND  If the specified profile was not found.
PROFILE_NOT_LOADED  If the specified profile is currently not loaded.
PROFILE_NOT_EXISTS  If the specified profile does not exists.
PROFILE_ALREADY_EXISTS  If the profile you requesting already exists.
VFS_ERROR  This is an error defining the virtual file system error group.
VFS_ALREADY_OPEN  If you try to open the file system and it is already opened.
VFS_CANNOT_OPEN  If the engine couldn't open the virtual file system.
VFS_CANNOT_CLOSE  If the vfs subsystem couldn't be closed.
VFS_IS_NOT_OPEN  Do you tried to request a file, but forgott to open the file system?
VFS_FILE_NOT_FOUND  The requested file was not found in the vfs.
VFS_FILE_NOT_OPEN  You can not retrieve data from a file, if it was not opened before.
VFS_FILE_END_REACHED  The reading of the file found an EOF signal.
VFS_FILE_READ_ERROR  File couldn't be readed for many of reasons.
VFS_LINE_READ_ERROR  The line of a file couldn't be readed.
VFS_SCAN_READ_ERROR  Scan methof fails because of wrong readed data or so.
VFS_SEEK_ERROR  Seeking in the file failed, probably the seek position is to wide.
VFS_NO_PARAMETER  No such parameter exists.
SETTINGS_ERROR  Any error produced by the settings manager is in this group.
SETTINGS_VAR_ALREADY_REGISTERED  If you try to register a variable that already registered.
SETTINGS_VAR_NOT_REGISTERED  The variable you requesting is not registered.
KERNEL_ERROR  Any error that is thrown in the kernel subsystem is in this group.
KERNEL_NO_TASK_FOUND  There were no task found.
KERNEL_NO_RIGHTS  You do not have rights for this operation.
KERNEL_TASK_NOT_READY  The appropriate task is not ready.
KERNEL_CIRCULAR_DEPENDENCY  This error comes if there is a circuit dependencies in the kernel task list.
KERNEL_TASK_MISSING  If tasks are missing, that should be in the pipeline.
KERNEL_END_REACHED  This error comes if an end of itarating is reached.
KERNEL_ALREADY_VISITED  This error comes if the given task was already updated in this cycle.
KERNEL_LEAF_TASK  We are on the leaf in the task dependency tree.
CLOCK_ERROR  Our clock subsystem has got also it's own error group.
CLOCK_OBSERVER_NOT_FOUND  There is no time observer.
CLOCK_OBSERVER_ALREADY_ADDED  This observer is already observing the time.
CLOCK_NO_TIME_SOURCE  No time source is currently bounded.
FW_ERROR  There are errors produced by the engine's framework subsystem.
FW_CANNOT_INITIALIZE  THe framework couldn't be initialized.
FW_FAILED_TO_RESIZE  The framework is failed to resize.
FW_INVALID_RC_ID  The rendering context id you give is not valid.
FW_ALREADY_INIT  The framework is already initialized.
FW_NOT_INITIALIZED  The framework subsystem is not initialized at the moment.
FW_RC_CANNOT_SETUP_PIXEL_FORMAT  The rendering context couldn't setup the pixel format.
RES_ERROR  Each error produced by the resource manager is in this group.
RES_LOADER_ALREADY_EXISTS  For this type of resources there is already a loader.
RES_LOADER_NOT_REGISTERED  The loader is not registered.
RES_ALREADY_EXISTS  This resource alreaedy exists in the resource database.
RES_BAD_FILETYPE  The file type of the resource is not valid.
RES_CAN_NOT_LOAD_EMPTY  Empty resource couldn't be loaded.
RES_NOT_FOUND  The requested resource was not found.
RES_LOADER_NOT_EXISTS  There is no loader for such kind of resources.
RES_IS_EMPTY  This resource is empty.
RES_GROUP_NOT_FOUND  Such resource group was not found.
RES_PTR_IS_NULL  The pointer to the resource is equal to null.
RES_TYPE_NOT_SUPPORTED  The resource type of the given resource is not supported.
RES_LOCK_STATE_STACK_IS_FULL  We can not lock anymore, because the lock state stack is full.
RES_NO_EMPTY_RES_FOUND  No empty resource was created before.
PLG_ERROR  This are plugin managment errors.
PLG_COULD_NOT_LOAD  Plugin could not be loaded.
PLG_CANNOT_INITIALIZE  Plugin library could not been initialized.
PLG_EXTERNAL_ERROR  Plugin throws an error.
PLG_SYMBOL_NOT_FOUND  Plugin symbol is not defined.
PLG_WRONG_VERSION  Plugin version does not accords to the engine's one.
PLG_UNLOAD_ERROR  Plugin could not been unloaded properly.
SCRIPT_ERROR  Generic script error.
SCRIPT_PARSE_ERROR  The given script could not be parsed.
SCRIPT_FUNCTION_REGISTERED  The function you want register is already in the database.
SCRIPT_FUNCTION_NOT_REGISTERED  The function you want access is is not in the database.
SCRIPT_FUNCTION_NOT_FOUND  This function was not found in the script.
SCRIPT_WRONG_PARAMETER_VALUE  Wrong parameter value given.
SCRIPT_ALREADY_RUNNING  Script is already running.
EVENT_ERROR  Generic event management error.
EVENT_CHANNEL_EXISTS  We already does have this event channel in our database.
EVENT_NO_CHANNEL_FOUND  There is no channel whith the given name.
EVENT_ALREADY_CONNECTED  The actor is already connected to a certain communication channel.
EVENT_NOT_CONNECTED  The actor is not connected to a certain communication channel.
EVENT_CHANNEL_NOT_EXISTS  We do not have this event channel in our database.
EVENT_COULD_NOT_CAST  Event of the given type could not be casted to another type.
EVENT_FACTORY_FOUND  A given factory name is already in the database.
EVENT_FACTORY_NOT_FOUND  There is no such factory with the given name.
EVENT_NO_VALID_ACTOR  Given actor is not valid.
PROPERTY_ERROR  Generic group for properties errors.
PROPERTY_NOT_EXISTS  No such property exists.
PROPERTY_WRONG_TYPE  Wrong property type, so cannot cast.
ENGINE_ERROR  This are general engine layer errors.

Definition at line 44 of file Result.h.


Generated on Wed Sep 12 23:19:43 2007 for nrEngine by  doxygen 1.5.1