Just guessing here: I think your source json
is not giving you what you think it's giving you in terms of the type of the value.
I'm not familiar with json-spirit, but your link has this paragraph:
You obtain the Value's type by calling Value::type(). You can then call the appropriate getter function. Generally, you will know a file's format, so you will know what type the JSON values should have. A std::runtime_error exception is thrown if you try to get a value of the wrong type, for example, if you try to extract a string from a value containing an integer.
This sounds an awful lot like the error you're seeing. I'm guessing json-spirit thinks your strings aren't strings at all. When you try to call get_str()
on something that's not a string (whatever is defined as type "0") it's throwing an exception.
EDIT: poking around in json-spirit's source, type "0" is NULL_TYPE