Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_strerror.rst
1 Converting Error Codes to Messages
2 ==================================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc)
11
12 :param ptr: pointer to initialized `memcached_st` struct
13 :param rc: `memcached_return_t` value to query the string representation for
14 :returns: the string representation of `rc`
15
16 DESCRIPTION
17 -----------
18
19 `memcached_strerror` takes a `memcached_return_t` value and returns a string
20 describing the error.
21
22 This string must not be modified by the application.
23
24 `memcached_return_t` values are returned from nearly all libmemcached(3)
25 functions.
26
27 `memcached_return_t` values are of an enum type so that you can set up responses
28 with switch/case and know that you are capturing all possible return values.
29
30 RETURN VALUE
31 ------------
32
33 `memcached_strerror` returns a string describing a `memcached_return_t` value.
34
35 SEE ALSO
36 --------
37
38 .. only:: man
39
40 :manpage:`memcached(1)`
41 :manpage:`libmemcached(3)`
42 :manpage:`memcached_return_t`
43
44 .. only:: html
45
46 * :manpage:`memcached(1)`
47 * :doc:`../libmemcached`
48 * :doc:`memcached_return_t`