whio  Update of "whio_rc"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 1c50b4907abcc8f37a7ad72b7ec619654ef90a41
Page Name:whio_rc
Date: 2011-05-23 18:50:57
Original User: stephan
Parent: 50268571b11c6e4e552fbdc2cd8d1334280955e2
Content

ACHTUNG: AS OF 20110523, THIS PAGE IS NOW MAINTAINED IN THE NEW WIKI: http://whiki.wanderinghorse.net/wikis/whio/?page=whio_rc

whio_rc: error codes

whio uses integers, almost exclusively, for reporting errors. The routines which return integer values use codes defined in the global whio_rc object. The codes have symbolic names, and in fact their actual values are not public in the API. This encourages (well, forces) developers to use the symbolic names. Unlike an enum, however, there is only one global symbol containing the error codes, rather than one global symbol per error code.

API documentation documents error codes in terms of these values. e.g. they might say "fails with whio_rc.ArgError when ...". The function whio_rc_string() takes an integer code and returns a string in the form "whio_rc.ErrorCodeName", which is often helpful in diagnosing problems (since the values of the error codes are not published).

The codes are summarized in the following table, and are accessible in C code using whio_rc.ErrorCodeName:

Error code name

Summary

OK

The non-error value, always equals 0.

ArgError

Error in argument handling (e.g. unexpected arg type, count, etc.).

IOError

Read or write error.

AllocError

Memory allocation error.

InternalError

An internal error in the API.

RangeError

An out-of-range error. e.g. wrong size or value.

InterruptedError

Indicates that an operation was interrupted by a signal, or possibly by a routine provided for the purpose of interrupting a long-running action.

AccessError

A requested resource could not be accessed, or write permissions are required but denied.

ConsistencyError

A data consistency error (or a bug makes the data look corrupted even though it is not).

NYIError

Indicates that the called routine is not yet implemented.

UnsupportedError

Indicates that the requested option or operation is not supported.

TypeError

Indicates some form of type mismatch or an unexpected type.

DeviceFullError

Indicates that some device-specific operation has determined that the device is full and cannot take more input.

LockingError

Indicates some form of device-specific locking error, for devices which support locking.

HashingError

Indicates some form of device-specific hashing-related error.

ConcurrentModificationError

A specialized case of LockingError which specifies that a device was modified by a concurrent thread or process. Note that this support must explicitly be built in to a device, so do not expect most library routines to ever return this unless they document it.

NotFoundError

Indicates some resource could not be found.

WTFError

The catch-all "nobody really knows what happened" error.

SizeTError

Special case: this is not an integer, but is (whio_size_t)-1 (the maximum value of whio_size_t). The integer error code -1 is not used by this library, to avoid potential confusion with SizeTError.