Enum cpython_json::JsonError[]

pub enum JsonError {
    PythonError(PyErr),
    SerdeJsonError(Error),
    TypeError(StringPyResult<String>),
    DictKeyNotString(PyObject),
    InvalidFloat,
    ImpossibleNumber,
}

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 because of a serde_json error.

The PyObject passed could not be converted to a serde_json::Value object because we didn't recognize it as a valid JSON-supported type.

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] (https://github.com/ilianaw/rust-cpython-json/issues) 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.

A number provided is not a valid JSON float (infinite and NaN values are not supported in JSON).

The serde_json crate lied to us and a Number is neither u64, i64, or f64.

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. Read more

impl Display for JsonError

Formats the value using the given formatter. Read more

impl Error for JsonError

This method is soft-deprecated. Read more

The lower-level cause of this error, if any. Read more

impl From<PyErr> for JsonError

Performs the conversion.

impl From<Error> for JsonError

Performs the conversion.

Auto Trait Implementations

impl Send for JsonError

impl Sync for JsonError