Browse Source

Add more verbosity to parsing of values.

tags/1.0.3
Vsevolod Stakhov 8 years ago
parent
commit
157bb592f4
1 changed files with 29 additions and 18 deletions
  1. 29
    18
      src/libserver/cfg_rcl.c

+ 29
- 18
src/libserver/cfg_rcl.c View File

g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot convert param to double");
"cannot convert param %s to double", ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot convert param to double");
"cannot convert param %s to double", ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"invalid flags to parse time value");
"invalid flags to parse time value in %s", ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"invalid string with keypair content");
"invalid string with keypair content for %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }
} }
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"no sane pubkey found in the keypair");
"no sane pubkey found in the keypair: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }
elt = ucl_object_find_key (obj, "privkey"); elt = ucl_object_find_key (obj, "privkey");
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"no sane privkey found in the keypair");
"no sane privkey found in the keypair: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }
} }
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"no sane pubkey or privkey found in the keypair");
"no sane pubkey or privkey found in the keypair: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot load the keypair specified");
"cannot load the keypair specified: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot convert an object or array to string");
"cannot convert an object or array to string: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"an array of strings is expected");
"an array of strings is expected: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


} }
else { else {
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR,
EINVAL,
"cannot convert an object to boolean");
CFG_RCL_ERROR,
EINVAL,
"cannot convert an object to boolean: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


} }
else { else {
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR,
EINVAL,
"cannot convert an object to inet address");
CFG_RCL_ERROR,
EINVAL,
"cannot convert an object to inet address: %s",
ucl_object_key (obj));
return FALSE; return FALSE;
} }


g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot parse inet address: %s", val);
"cannot parse inet address: %s in %s", val,
ucl_object_key (obj));
ucl_object_iterate_free (it); ucl_object_iterate_free (it);


return FALSE; return FALSE;
g_set_error (err, g_set_error (err,
CFG_RCL_ERROR, CFG_RCL_ERROR,
EINVAL, EINVAL,
"cannot get inet address from ucl object");
"cannot get inet address from ucl object in %s",
ucl_object_key (obj));
ucl_object_iterate_free (it); ucl_object_iterate_free (it);


return FALSE; return FALSE;

Loading…
Cancel
Save