mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
Made JSON error message verbose.
This commit is contained in:
parent
66e7dc700d
commit
aaa9f62b3e
@ -224,7 +224,7 @@ static const char def_conf[] = "cgminer.conf";
|
|||||||
static bool config_loaded;
|
static bool config_loaded;
|
||||||
static int include_count;
|
static int include_count;
|
||||||
#define JSON_INCLUDE_CONF "include"
|
#define JSON_INCLUDE_CONF "include"
|
||||||
#define JSON_LOAD_ERROR "JSON decode of file '%s' failed"
|
#define JSON_LOAD_ERROR "JSON decode of file '%s' failed\n %s"
|
||||||
#define JSON_LOAD_ERROR_LEN strlen(JSON_LOAD_ERROR)
|
#define JSON_LOAD_ERROR_LEN strlen(JSON_LOAD_ERROR)
|
||||||
#define JSON_MAX_DEPTH 10
|
#define JSON_MAX_DEPTH 10
|
||||||
#define JSON_MAX_DEPTH_ERR "Too many levels of JSON includes (limit 10) or a loop"
|
#define JSON_MAX_DEPTH_ERR "Too many levels of JSON includes (limit 10) or a loop"
|
||||||
@ -1105,11 +1105,11 @@ static char *load_config(const char *arg, void __maybe_unused *unused)
|
|||||||
config = json_load_file(arg, &err);
|
config = json_load_file(arg, &err);
|
||||||
#endif
|
#endif
|
||||||
if (!json_is_object(config)) {
|
if (!json_is_object(config)) {
|
||||||
json_error = malloc(JSON_LOAD_ERROR_LEN + strlen(arg));
|
json_error = malloc(JSON_LOAD_ERROR_LEN + strlen(arg) + strlen(err.text));
|
||||||
if (!json_error)
|
if (!json_error)
|
||||||
quit(1, "Malloc failure in json error");
|
quit(1, "Malloc failure in json error");
|
||||||
|
|
||||||
sprintf(json_error, JSON_LOAD_ERROR, arg);
|
sprintf(json_error, JSON_LOAD_ERROR, arg, err.text);
|
||||||
return json_error;
|
return json_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user