mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
Give a better error message than 'type mismatch' for complex JSON arguments
This commit is contained in:
parent
ab0d6428b1
commit
18871d4785
@ -2957,8 +2957,9 @@ void ConvertTo(Value& value)
|
|||||||
{
|
{
|
||||||
// reinterpret string as unquoted json value
|
// reinterpret string as unquoted json value
|
||||||
Value value2;
|
Value value2;
|
||||||
if (!read_string(value.get_str(), value2))
|
string strJSON = value.get_str();
|
||||||
throw runtime_error("type mismatch");
|
if (!read_string(strJSON, value2))
|
||||||
|
throw runtime_error(string("Error parsing JSON:")+strJSON);
|
||||||
value = value2.get_value<T>();
|
value = value2.get_value<T>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user