Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_last_error.rst
1 Retrieving Error Codes and Messages
2 ===================================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: memcached_return_t memcached_last_error(const memcached_st *ptr)
11
12 :param ptr: pointer to an initialized `memcached_st` struct
13 :returns: `memcached_return_t` indicating success of last operation
14
15 .. function:: const char *memcached_last_error_message(const memcached_st *ptr)
16
17 :param ptr: pointer to an initialized `memcached_st` struct
18 :returns: message describing the status of last operation
19
20 .. function:: int memcached_last_error_errno(const memcached_st *ptr)
21
22 :param ptr: pointer to an initialized `memcached_st` struct
23 :returns: :manpage:`errno(3)` (if any) of last operation
24
25 DESCRIPTION
26 -----------
27
28 Retrieve error codes and messages.
29
30 RETURN VALUE
31 ------------
32
33 `memcached_last_error` returns the last error code.
34
35 `memcached_last_error_message` returns the last error message. If this error
36 came from a specific server, its hostname and port will be provided in the error
37 message. Any error message will be returned as 'const char \*' which does not
38 need to be de-allocated. NULL will be returned if no error has occurred.
39
40 `memcached_last_error_errno` returns any last local error code obtained from
41 :manpage:`errno(3)`.
42
43 SEE ALSO
44 --------
45
46 .. only:: man
47
48 :manpage:`memcached(1)`
49 :manpage:`errno(3)`
50 :manpage:`libmemcached(3)`
51 :manpage:`memcached_strerror(3)`
52
53 .. only:: html
54
55 * :manpage:`memcached(1)`
56 * :manpage:`errno(3)`
57 * :doc:`../libmemcached`
58 * :doc:`memcached_strerror`