ds = plugin_get_ds(rq->type);
if (!ds) {
- ERROR("redis plugin: DataSet `%s' not defined.", rq->type);
+ ERROR("redis plugin: DS type `%s' not defined.", rq->type);
return -1;
}
if (ds->ds_num != 1) {
- ERROR("redis plugin: DS `%s' has too many types.", rq->type);
+ ERROR("redis plugin: DS type `%s' has too many datasources. This is not "
+ "supported currently.",
+ rq->type);
return -1;
}
break;
case REDIS_REPLY_STRING:
if (parse_value(rr->str, &val, ds->ds[0].type) == -1) {
- WARNING("redis plugin: Unable to parse field `%s'.", rq->type);
+ WARNING("redis plugin: Query `%s': Unable to parse value.", rq->query);
freeReplyObject(rr);
return -1;
}
break;
+ case REDIS_REPLY_ERROR:
+ WARNING("redis plugin: Query `%s' failed: %s.", rq->query, rr->str);
+ freeReplyObject(rr);
+ return -1;
+ case REDIS_REPLY_ARRAY:
+ WARNING("redis plugin: Query `%s' should return string or integer. Arrays "
+ "are not supported.",
+ rq->query);
+ freeReplyObject(rr);
+ return -1;
default:
- WARNING("redis plugin: Cannot coerce redis type.");
+ WARNING("redis plugin: Query `%s': Cannot coerce redis type (%i).",
+ rq->query, rr->type);
freeReplyObject(rr);
return -1;
}
rh = redisConnectWithTimeout((char *)rn->host, rn->port, rn->timeout);
if (rh == NULL) {
- ERROR("redis plugin: unable to connect to node `%s' (%s:%d).", rn->name,
- rn->host, rn->port);
+ ERROR("redis plugin: can't allocate redis context");
+ continue;
+ }
+ if (rh->err) {
+ ERROR("redis plugin: unable to connect to node `%s' (%s:%d): %s.",
+ rn->name, rn->host, rn->port, rh->errstr);
+ redisFree(rh);
continue;
}