- memcached_string_t local_string;
- local_string.size= strlen(str);
- local_string.c_str= str;
- memcached_set_error(parser->memc, MEMCACHED_FAILURE, &local_string);
+ (void)error;
+ if (context->rc == MEMCACHED_SUCCESS)
+ context->rc= MEMCACHED_PARSE_ERROR;
+
+ std::string error_message;
+ error_message+= context->begin;
+ error_message+= " (";
+ error_message+= memcached_strerror(NULL, context->rc);
+ error_message+= ")";
+
+ memcached_set_error_string(context->memc, context->rc, error_message.c_str(), error_message.size());