Enum cpython_json::JsonError [] [src]

pub enum JsonError {
    PythonError(PyErr),
    TypeError(StringPyResult<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

A Python exception occurred.

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.

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.

Methods

impl JsonError
[src]

Convenience method for converting a JsonError to a PyErr.

Trait Implementations

impl Debug for JsonError
[src]

Formats the value using the given formatter.

impl From<PyErr> for JsonError
[src]

Performs the conversion.