whio  whio_rc

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



The non-error value, always equals 0.


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


Read or write error.


Memory allocation error.


An internal error in the API.


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


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


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


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


Indicates that the called routine is not yet implemented.


Indicates that the requested option or operation is not supported.


Indicates some form of type mismatch or an unexpected type.


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


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


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


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.


Indicates some resource could not be found.


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


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.