Converts JSON string to a value.
expected The value or string describing an error.
The string to be converted.