Error Codes
From PX Documentation
Introduction
This page will outline the codes associated with the return types of functions. This can be found at nd/include/ND.h
| Function | Default Result | Error Code |
| NDSendEventResult | If no error occurs, returns NDSendEventResult::ok | invalidType = -7, connOwnerIDMismatch = -6, ownerIDNotFound = -5, ownerIDInvalid = -4, channelInvalid = -3, evtInvalid = -2, timeout = -1, ok = 0 |
| NDEventDataGetUserEvent | Always returns void* (the user event) which may be NULL | None |
| NDEventDataGetChannelIDResult | If no error occurs, returns the channel ID | nullEvent = -1 |
| NDEventDataGetConnIDResult | If no error occurs, returns the connID | nullEvent = -1 |
| NDEventDataGetEventTypeResult | If no error occurs, returns the typeID of the event (which is nonzero) | nullEvent = 0 |
| NDEventDataGetTimeResult | If no error occurs, returns the universe time of the event | nullEvent = -1 |
| NDEventDataGetOriginIDResult | If no error occurs, returns the ownerID of the original sender of the event | nullEvent = -1 |
| NDEventDataSetAllIDsValidResult | If no error occurs, returns NDEventDataSetAllIDsValidResult::ok | nullEvent = -4, internalError = -3, validatedIDListFull = -2, invalidChannelID = -1, ok = 0 |
| NDEventDataSetAllIDsInvalidResult | If no error occurs, returns NDEventDataSetAllIDsInvalidResult::ok | nullEvent = -2, invalidChannelID = -1, ok = 0 |
| NDEventDataSetIDValidResult | If no error occurs, returns NDEventDataSetAllIDValidResult::ok | nullEvent = -4, cannotBeValid = -3, validatedIDListFull = -2, invalidChannelID = -1, ok = 0 |
| NDEventDataSetIDInvalidResult | If no error occurs, returns NDEventDataSetIDInvalidResult::ok | nullEvent = -2, invalidChannelID = -1, ok = 0 |
| NDEventDataGetNextValidIDResult | If no error occurs, returns the next ID in the sequence, or NDEventDataGetNextValidIDResult::noMoreIDs when the sequence has ended | nullEvent = -5, noMoreIDs = -4, internalErrorA = -3, internalErrorB = -2, invalidChannelID = -1, ok = 0 |
| NDEventDataGetNextValidIDResetResult | If no error occurs, returns NDEventDataGetNextValidIDResetResult::ok | nullEvent = -1, ok = 0 |
| NDEventDataGetObjectIDResult | If no error occurs, returns the objectID associated with this event | nullData = -1 |
| NDEventDataGetFieldIDResult | If no error occurs, returns the object fieldID associated with this event | nullData = -1 |
| NDEventDataSetFieldDataResult | If no error occurs, returns NDEventDataSetFieldDataResult::ok | nullData = -7, nullNewData = -6, invalidFieldID = -5, noSuchObjectID = -4, noSuchObjectType = -3, fieldNotRegistered = -2, invalidChannelID = -1, ok = 0 |
| NDSimDataGetChannelIDResult | If no error occurs, returns the channelID associated with this simData | nullData = -1 |
| NDSimDataGetUniverseTimeResult | If no error occurs, returns the universe time associated with this simData | nullData = -1 |
| NDSimDataGetLastSimTimeResult | If no error occurs, returns the last simulation time associated with this simData | nullData = -1 |
| NDEventDataGetObjectTypeResult | If no error occurs, returns the last object typeID associated with this event | nullData = -1 |
| NDEventDataGetObject | Always returns void* (the object associated with this event) or NULL in the case of failure | None |
| NDEventLoop | Always returns void | None |
| NDGetEventName | Returns a char* or NULL only | None |
| NDInstallEventTypeResult | If no error occurs, returns the event typeID | alreadyInstalled = -5, mallocError = -4, storageError = -3, invalidType = -2, invalidChannelID = -1 |
| NDInstallObjectTypeResult | If no error occurs, return the object typeID | invalidArgument = -4, mallocError = -3, storeError = -2, invalidChannelID = -1 |
| NDCreateObjectResult | If no error occurs, returns NDCreateObjectResult::ok | invalidArgument = -3, serializationFailed = -2, invalidChannelID = -1, ok = 0 |
| NDDeleteObjectResult | If no error occurs, returns NDDeleteObjectResult::ok | invalidArgument = -2, invalidChannelID = -1, ok = 0 |
| NDBeginObjectUpdateResult | If no error occurs, returns NDBeginObjectUpdateResult::ok | invalidChannelID = -1, ok = 0 |
| NDEndObjectUpdateResult | If no error occurs, returns NDEndObjectUpdateResult::ok | invalidChannelID = -1, ok = 0 |
| NDUpdateObjectFieldResult | If no error occurs, returns NDUpdateObjectFieldResult::ok | invalidFieldID = -6, channelHasNoObjectManager = -5, noSuchObjectID = -4, noSuchObjectType = -3, fieldNotRegistered = -2, invalidChannelID = -1, ok = 0 |
| NDRegisterFieldResult | If no error occurs, returns NDRegisterFieldResult::ok | invalidSize = -8, noSuchObjectType = -7, negativeFieldID = -6, fieldIDTooLarge = -5, invalidFieldType = -4, invalidOffset = -3, channelHasNoObjectManager = -2, invalidChannelID = -1, ok = 0 |
| NDOGetNumObjectsResult | If no error occurs, returns the number of objects in the specified channel | channelHasNoObjectManager = -2, invalidChannelID = -1 |
| NDOGetByID | Either returns void* (an object) or NULL | None |
| NDOGetByType | Either returns void* (an object) or NULL | None |
| NDOGetByTypeID | Either returns void* (an object) or NULL | None |
| NDOGetTypeName | Either returns char* (the type name) or NULL | None |
| NDConnGetFlagsResult | If no error occurs, returns the flags for the specified conn | noSuchConn = -1 |
| NDConnCloseResult | If no error occurs, returns NDConnCloseResult::ok | noSuchConn = -1, ok = 0 |
| NDConnGetLocalOwnerIDResult | If no error occurs, returns the local ownerID of the channel to which the specified conn belongs | noSuchConn = -1 |
| NDConnSetLocalOwnerIDResult | If no error occurs, returns NDConnSetLocalOwnerIDResult::ok | noSuchConn = -1, ok = 0 |
| NDConnGetRemoteOwnerIDResult | If no error occurs, returns the ownerID of the remote party to which this conn is connected | noSuchConn = -1 |
| NDConnGetRemoteAddr | Returns a sockaddr_in* containing the remote address this conn is connected to, or NULL on failure | None |
| NDConnIsStarted | Returns 0 if the session has not started, 1 if it has started | None |
| NDConnSetTimeoutResult | If no error occurs, returns NDConnSetTimeoutResult::ok | invalidTime = -2, noSuchConn = -1, ok = 0 |
| NDSetCullingDataResult | Returns 0 if no error | invalidArgument = -2, invalidChannelID = -1, ok = 0 |
| NDCreateClientConnResult | If no error occurs, returns the connID for the conn that was created | invalidIP = -6, invalidPort = -5, NDExpired = -4, connCreationFailed = -3, connAlreadyClosed = -2, invalidChannelID = -1 |
| NDCreateServerConnResult | If no error occurs, returns the connID for the conn that was created | NDExpired = -3, connCreationFailed = -2, invalidChannelID = -1 |
| NDCloseAllConns | Always returns void | None |
| NDGetNumConnsResult | If no error occurs, returns the number of connections in the specified channel | invalidChannelID = -1 |
| NDGetNumClientsResult | If no error occurs, returns the number of clients on the specified channel | invalidChannelID = -1 |
| NDGetNumServersResult | If no error occurs, returns the number of servers on the specified channel | invalidChannelID = -1 |
| NDGetConnByOwnerIDResult | If no error occurs, returns the connID for the conn with the specified remote ownerID | connNotFound = -2, invalidChannelID = -1 |
| NDGetClientConnByOwnerIDResult | If no error occurs, returns the connID for the client conn with the specified remote ownerID | connNotFound = -2, invalidChannelID = -1 |
| NDGetServerConnByOwnerIDResult | If no error occurs, returns the connID for the server conn with the specified remote ownerID | connNotFound = -2, invalidChannelID = -1 |
| NDGetDefaultChannel | Always returns the default channelID | None |
| NDSetDefaultChannelResult | If no error occurs, returns ok | invalidChannelID = -1, ok = 0 |
| NDGetChannelByConnIDResult | If no error occurs, returns the channelID for the channel containing this connID | invalidConnID = -1 |
| NDCreateChannelResult | If no error occurs, returns the channelID | creationFailed = -1 |
| NDChannelGetDescription | Always returns a char* or NULL | None |
| NDChannelSetDescription | Always returns void | None |
| NDChannelGetOwnerIDResult | If no error occurs, returns the local ownerID for the specified channel | invalidChannelID = -1 |
| NDChannelSetOwnerID | Always returns void | None |
| NDChannelSetRole | Always returns void | None |
| NDChannelGetRoleResult | If no error occurs, returns an the role (type NDRole) for this channel | invalidChannelID = -1 |
| NDChannelSetFlags | Always returns void | None |
| NDChannelUnsetFlags | Always returns void | None |
| NDChannelGetFlagsResult | If no error occurs, returns the flags for the specified channel | invalidChannelID = -1 |
| NDChannelExistsResult | Returns whether the specified channel exists | doesNotExist = 0, exists = 1 |
| NDChannelGetAddrResult | If no error occurs, returns NDChannelGetAddrResult::ok | invalidChannelID = -1, ok = 0 |
| NDChannelToChannelMessageResult | If no error occurs, returns NDChannelToChannelMessageResult::ok | invalidSourceChannelID = -3, invalidDestChannelID = -2, nullMessage = -1, ok = 0 |
| NDStartSession | Always returns void | None |
| NDEndSession | Always returns void | None |
| NDGetUniverseTimeResult | If no error occurs, returns the universe time (in milliseconds) for the specified channel | invalidChannelID = -1 |
| NDInstallSimulationCallbackResult | If no error occurs, returns NDInstallSimulationCallbackResult::ok | invalidChannelID = -1, ok = 0 |
| NDTime | Always returns the time in seconds since the epoch (1/1/1970) | None |
| NDTimeMS | Always returns the time in milliseconds since ND was initialized | None |
| NDSleepMS | Always returns void | None |
| NDRandom | Always returns a random integer on the interval [0,max) | None |
| NDDefaultDebugCallback | Always returns void | None |
| NDSetDebugCallback | Always returns void | None |
| NDSetDebugLevel | Always returns void | None |
| NDGetDebugLevel | Always returns the current debug level | None |
| NDSetNetDebug | Always returns void | None |
| NDGetNetDebugResult | Returns value indicating whether net debug is enabled | off = 0, on = 1 |
