Description

Tells why deserializeJson() or deserializeMsgPack() failed.

Values

DeserializationError::Ok
DeserializationError::IncompleteInput
DeserializationError::InvalidInput
DeserializationError::NoMemory
DeserializationError::NotSupported
DeserializationError::TooDeep

Methods

// return a string representation of the error
const char* c_str() const;

Example

DynamicJsonDocument doc;
auto err = deserializeJson(doc, "!!NOT JSON!!");
if (err) {
    Serial.print(F("deserializeJson() failed: "))
    Serial.println(err.c_str())
}

the program above would print:

deserializeJson() failed: InvalidInput

See also