Programming Guide



sm_prop_error

Gets the error code returned by the last properties API function call

#include <smuprapi.h>
int sm_prop_error(void);

Returns

Description

sm_prop_error gets the error code returned by the last-called properties API function: sm_prop_get, sm_prop_set, sm_prop_id, or one of their variants. This function is especially useful for ascertaining the success or failure of calls to variants that do not return an error code—for example, sm_prop_get_str, which returns 0 when an error occurs.

Because Panther internal processing also uses the properties API, you should call this function and retrieve the desired error code immediately.

Note: A negative value returned by sm_prop_get_int and its variants usually specifies an error. However, some integer properties accept negative values; in these cases, you can differentiate between a negative property value and an error condition only by calling sm_prop_error.

Example

/* Act on error code */

switch (sm_prop_error())
{
case '0':
...
break;
case PR_E_ERROR:
...
break;
case PR_E_MALLOC:
...
break;
...
default:
...
}