- text, errno = handle:lastError()
- handle:clearError()
- handle:setError(errno)
SYNOPSIS
DESCRIPTION
When any of the other functions working on a file handle indicates an error condition, the error is stored inside the handle and can be retrieved by calling rawio:lastError().
When the error has been handled by the application, it can be cleared by calling rawio:clearError().
To manually simulate an error condition, pass a numeric errno code to rawio:setError().
RETURN VALUE
If an error has been stored, returns two values: a string describing the error and an error code.
If the error code is a positive number, it is an errno code from the standard C library. The descriptive string that is returned is the result of calling the C standard function strerror() with that code.
If the error code is a negative number, it is an error reported by the PolarSSL library. The descriptive string in that case is also retrieved from PolarSSL.
If no error has been stored, returns nil.