Enum cpython_json::JsonError
[−]
[src]
pub enum JsonError { PythonError(PyErr), TypeError(String, PyResult<String>), DictKeyNotString(PyObject), }
The Error
enum returned by this crate.
Most of the time you will just want a PyErr
, and to_pyerr
will convert to one for you.
Variants
PythonError(PyErr)
A Python exception occurred.
TypeError(String, PyResult<String>)
The PyObject passed could not be converted to a serde_json::Value
object.
The error tuple is the type name, then the repr
of the object.
This usually means that Python's json
module wouldn't be able to serialize the object
either. If the Python json
module works but cpython-json
doesn't, please file an
issue with your test case.
DictKeyNotString(PyObject)
A dict
key was not a string object, and so it couldn't be converted to an object. JSON
object keys must always be strings.