- for (int i = 0; i < ci->children_num; i++) {
- if (ci->children[i].children == NULL)
- dispatch_value_plugin(name, ci->children + i);
- else {
+ for (int i = 0, ret = 0; i < ci->children_num; i++) {
+ if (ci->children[i].children == NULL) {
+ oconfig_item_t *child = ci->children + i;
+ ret = dispatch_value_plugin(name, child);
+ if (ret != 0) {
+ ERROR("Plugin %s failed to handle option %s, return code: %i", name,
+ child->key, ret);
+ return ret;
+ }
+ } else {