# Error Reporting

VSL routines return status codes of the performed operation to report errors and warnings to the calling program. Thus, it is up to the application to perform error-related actions and/or recover from the error. The status codes are of integer type and have the following format:

VSL_ERROR_<ERROR_NAME> - indicates VSL errors

VSL_WARNING_<WARNING_NAME> - indicates VSL warnings.

VSL errors are of negative values while warnings are of positive values. The status code of zero value indicates that the operation is completed successfully: VSL_ERROR_OK (or synonymic VSL_STATUS_OK).

Status Codes and Messages
Status Code | Message
--- | ---
VSL_ERROR_OK, VSL_STATUS_OK | Indicates no error, execution is successful.
VSL_ERROR_BAD_ARG | Input argument value is not valid.
VSL_ERROR_NULL_PTR | Input pointer argument is NULL.
VSL_ERROR_MEM_FAILURE | System cannot allocate memory.
VSL_ERROR_INVALID_BRNG_INDEX | BRNG index is not valid.
VSL_ERROR_BRNGS_INCOMPATIBLE | Two BRNGs are not compatible for the operation.
VSL_ERROR_LEAPFROG_UNSUPPORTED | BRNG does not support Leapfrog method.
VSL_ERROR_SKIPAHEAD_UNSUPPORTED | BRNG does not support Skip-Ahead method.
VSL_ERROR_BAD_STREAM | The random stream is invalid.
VSL_ERROR_FILE_OPEN | Indicates an error in opening the file.
VSL_ERROR_FILE_READ | Indicates an error in reading the file.
VSL_ERROR_FILE_WRITE | Indicates an error in writing the file.
VSL_ERROR_FILE_CLOSE | Indicates an error in closing the file.
VSL_ERROR_BAD_FILE_FORMAT | File format is unknown.
VSL_ERROR_UNSUPPORTED_FILE_VER | File format version is not supported.
VSL_ERROR_BRNG_TABLE_FULL | Registration cannot be completed due to lack of free entries in the table of registered BRNGs.
VSL_ERROR_BAD_STREAM_STATE_SIZE | The value in StreamStateSize field is bad.
VSL_ERROR_BAD_WORD_SIZE | The value in WordSize field is bad.
VSL_ERROR_BAD_NSEEDS | The value in NSeeds field is bad.
VSL_ERROR_BAD_NBITS | The value in NBits field is bad.
VSL_ERROR_BAD_UPDATE | Callback function for an abstract BRNG returns an invalid number of updated entries in a buffer, that is, < 0 or >nmax.
VSL_ERROR_NO_NUMBERS | Callback function for an abstract BRNG returns zero as the number of updated entries in a buffer.
VSL_ERROR_INVALID_ABSTRACT_STREAM | The abstract random stream is invalid.

Parent topic: Random Number Generators