udError

These are the shared return codes from most udSDK functions

Defines

UD_ERROR_VERSION

When used with the udCore library the udError codes are interchangable with the udResult codes when this version number matches.

Enums

enum udError

These are the various error codes returned by udSDK functions

!NOTE The 0 value is success, this is different to many C APIs and as such if(udFunction() == udE_Success) is required to handle success cases.

Values:

ValueDescription
udE_SuccessIndicates the operation was successful.
udE_FailureA catch-all value that is rarely used, internally the below values are favored.
udE_NothingToDoThe operation didn’t specifically fail but it also didn’t do anything.
udE_InternalErrorThere was an internal error that could not be handled.
udE_NotInitializedThe request can’t be processed because an object hasn’t been configured yet.
udE_InvalidConfigurationSomething in the request is not correctly configured or has conflicting settings.
udE_InvalidParameterOne or more parameters is not of the expected format.
udE_OutstandingReferencesThe requested operation failed because there are still references to this object.
udE_MemoryAllocationFailureudSDK wasn’t able to allocate enough memory for the requested feature
udE_CountExceededAn internal count was exceeded by the request, generally going beyond the end of a buffer or internal limit.
udE_NotFoundThe requested item wasn’t found or isn’t currently available.
udE_BufferTooSmallEither the provided buffer or an internal one wasn’t big enough to fufill the request.
udE_FormatVariationNotSupportedThe supplied item is an unsupported variant of a supported format.
udE_ObjectTypeMismatchThere was a mismatch between what was expected and what was found.
udE_CorruptDataThe data/file was corrupt.
udE_InputExhaustedThe input buffer was exhausted so no more processing can occur.
udE_OutputExhaustedThe output buffer was exhausted so no more processing can occur.
udE_CompressionErrorThere was an error in compression or decompression.
udE_UnsupportedThis functionality has not yet been implemented (usually some combination of inputs isn’t compatible yet).
udE_TimeoutThe requested operation timed out. Trying again later may be successful.
udE_AlignmentRequiredMemory alignment was required for the operation.
udE_DecryptionKeyRequiredA decryption key is required and wasn’t provided.
udE_DecryptionKeyMismatchThe provided decryption key wasn’t the required one.
udE_SignatureMismatchThe digital signature did not match the expected signature.
udE_ObjectExpiredThe supplied object has expired.
udE_ParseErrorA requested resource or input was unable to be parsed.
udE_InternalCryptoErrorThere was a low level cryptography issue.
udE_OutOfOrderThere were inputs that were provided out of order.
udE_OutOfRangeThe inputs were outside the expected range.
udE_CalledMoreThanOnceThis function was already called.
udE_ImageLoadFailureAn image was unable to be parsed. This is usually an indication of either a corrupt or unsupported image format.
udE_StreamerNotInitialisedThe streamer needs to be initialised before this function can be called.
udE_OpenFailureThe requested resource was unable to be opened.
udE_CloseFailureThe resource was unable to be closed.
udE_ReadFailureA requested resource was unable to be read.
udE_WriteFailureA requested resource was unable to be written.
udE_SocketErrorThere was an issue with a socket problem.
udE_DatabaseErrorA database error occurred.
udE_ServerErrorThe server reported an error trying to complete the request.
udE_AuthErrorThe provided credentials were declined (usually email or password issue).
udE_NotAllowedThe requested operation is not allowed (usually this is because the operation isn’t allowed in the current state).
udE_InvalidLicenseThe required license isn’t available or has expired.
udE_PendingA requested operation is pending.
udE_CancelledThe requested operation was cancelled (usually by the user).
udE_OutOfSyncThere is an inconsistency between the internal udSDK state and something external. This is usually because of a time difference between the local machine and a remote server.
udE_SessionExpiredThe udServer has terminated your session.
udE_ProxyErrorThere was some issue with the provided proxy information (either a proxy is in the way or the provided proxy info wasn’t correct).
udE_ProxyAuthRequiredA proxy has requested authentication.
udE_ExceededAllowedLimitThe requested operation failed because it would exceed the allowed limits (generally used for exceeding server limits like number of projects).
udE_RateLimitedThis functionality is currently being rate limited or has exhausted a shared resource. Trying again later may be successful.
udE_PremiumOnlyThe requested operation failed because the current session is not for a premium user.
udE_InProgressThe requested operation is currently in progress.
udE_DuplicateKeyThe unique key of the item submitted is already in use.
udE_CountInternally used to verify return values.

enum udProgressType

These are the various progress types for the progress handler

Values:

ValueDescription
udProgressType_PendingThe expected progress hasn’t started yet.
udProgressType_CompleteAlways updated at the end of the event (doesn’t not indicate success), this can be set during the process by sections (e.g. downloading might complete before the next step).
udProgressType_ParsingSomething is being parsed/decoded, etc. (at/of in Bytes).
udProgressType_ReadingSomething is being read in. (at/of are items).
udProgressType_WritingSomething is being written to. (at/of are items).
udProgressType_DownloadingA download is occuring. (at/of in Bytes).
udProgressType_UploadingAn upload is occuring. (at/of in Bytes).
udProgressType_CountThe total number of progress types in this enum.

Functions

const char *udError_GetErrorString(enum udError errorCode)

Gets the udError enum value as a string value.

ParameterDescription
errorCodeThe error code

Returns: A string representing the suppplied errorCode. This memory is owned by udSDK and does not need to be returned or freed and should not be modified

enum udError udProgressCallback(void *pProgressUserData, enum udProgressType progressType, int64_t atPosition, int64_t ofCount)

Callback invoked on when the internal status is updated to provide user feedback

Examples: Download Initialised: udProgressCallback("downloading", 0, -1, NULL) When downloading a file: udProgressCallback("downloading", 123, 456, "bytes") While parsing: udProgressCallback("parsing", 6, 62, "items")

ParameterDescription
pProgressUserDataThe pointer provided in the parent function, purely passthrough.
progressTypeThe type of event that occurred
atPositionThe index or count of the item being processed
ofCountThe total count of the items being processes in the current state, 0 if unknown and -1 if this was a once off state change (e.g. moving to downloading)

Returns: A udError to indicate if the process should continue, most functions will cancel on anything except udE_Success but it’s function specific