scache_strerror

Description

string scache_strerror(long errcode)
string $SCacheConnection->strerror([ long errcode]);

Retrieves string-representation of given errcode.

When used through class interface, errcode is optional. Method returns string-representation of last occurred error on connection, if no errcode is specified.

Parameters

Error code returned from scache_lasterr.

Return value

String containing textual representation of given errcode. Invalid errorcodes are translated to SCERR_UNKNOWN_ERROR

Notes

Error codes and their meanings are defined in constants.

Examples

<?php
/* get connection */
$session = scache_reset('MyEasilyGuessableSecret');
if (!scache_replace($session, 'unexisting/value', 'null')) {
    echo scache_strerror(scache_lasterr($session));
}
	
/* same with class interface */
$session = new SCache('MyEasilyGuessableSecret');
if (!$session->replace('unexisting/value', 'null')) {
    echo $session->strerror();
}
?>