+static void _error_print(const memcached_error_st *error)
+{
+ if (! error)
+ return;
+
+ if (! error->size)
+ {
+ fprintf(stderr, "%s\n", memcached_strerror(NULL, error->rc) );
+ }
+ else
+ {
+ fprintf(stderr, "%s %s\n", memcached_strerror(NULL, error->rc), error->c_str);
+ }
+
+ _error_print(error->next);
+}
+
+void memcached_error_print(const memcached_st *self)
+{
+ if (! self)
+ return;
+
+ _error_print(self->error_messages);
+}
+