00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "WOscException.h"
00040 #include <stdio.h>
00041
00042
00043
00044
00045 std::string
00046 WOscException::GetErrStr(ErrorCodes err)
00047 {
00048 switch ( err ) {
00049 case ERR_NO_ERROR: return
00050 "No error.";
00051 case ERR_NOT_ROOT_CONTAINER: return
00052 "Trying to set a child-container as address-space. Address-space must be a root-conatiner.";
00053 case ERR_REMOVE_FROM_EMPTY_QUEUE: return
00054 "Trying to remove items from an empty Queue.";
00055 case ERR_OSC_STR_BUFF_TOO_SMALL: return
00056 "Buffer too small when trying to copy string to buffer.";
00057 case ERR_BUFFER_TO_SMALL: return
00058 "Caller provided buffer to small when trying to copy the binary bundle content into it.";
00059 case ERR_INVALID_INDEX: return
00060 "Invalid index (out of bounds) when trying to remove an OSC-bundle from the enclosing bundle.";
00061 case ERR_NULL_ADDRESS: return
00062 "No address (NULL) supplied during message construction.";
00063 case ERR_NULL_BUFFER: return
00064 "Message initialization buffer is empty.";
00065 case ERR_NOT_DISPATCHING_FROM_ROOT: return
00066 "Can dispatch messages only when called from root container.";
00067 case ERR_INVALID_ADDRESS_NO_SLASH: return
00068 "Invalid address. Does not begin with slash (/).";
00069 case ERR_ROOT_ALIAS: return
00070 "This is the root container and the root container can not be aliased.";
00071 case ERR_RECURSIVE_ALIAS: return
00072 "Recursive aliasing not allowed.";
00073 case ERR_PARENT_POINTER_NULL: return
00074 "Invalid (NULL) parent container passed.";
00075 case ERR_TOO_SHORT: return
00076 "Bundle too short (parsing).";
00077 case ERR_EMPTY_BUNDLE: return
00078 "Bundle has no data (parsing).";
00079 case ERR_INVALID_TAG: return
00080 "Bundle has invalid tag. Should be \"#bundle\" (parsing).";
00081 case ERR_CURRUPT_BUNDLE_LAYOUT: return
00082 "Bundle layout invalid. Bundle size does not match the sum of the size of the individual bundle items (parsing).";
00083 case ERR_NO_ITEMS_IN_BUNDLE: return
00084 "No items in bundle (parsing).";
00085 case ERR_CAN_NOT_CLONE_UNINITIALIZED_BUNDLE: return
00086 "Can not clone an uninitialized bundle for priority queue insertion.";
00087 }
00088 char buffer[32];
00089 snprintf(buffer, 32, "Unknown error (%i).", err);
00090 return buffer;
00091 }