The QJsonParseError class is used to report errors during JSON parsing.

See also

JSON Support in Qt Saving and Loading a Game

Returns the human-readable message appropriate to the reported JSON parsing error.

See also

error

This enum describes the type of error that occurred during the parsing of a JSON document.

Constant

Description

QJsonParseError.NoError

No error occurred

QJsonParseError.UnterminatedObject

An object is not correctly terminated with a closing curly bracket

QJsonParseError.MissingNameSeparator

A comma separating different items is missing

QJsonParseError.UnterminatedArray

The array is not correctly terminated with a closing square bracket

QJsonParseError.MissingValueSeparator

A colon separating keys from values inside objects is missing

QJsonParseError.IllegalValue

The value is illegal

QJsonParseError.TerminationByNumber

The input stream ended while parsing a number

QJsonParseError.IllegalNumber

The number is not well formed

QJsonParseError.IllegalEscapeSequence

An illegal escape sequence occurred in the input

QJsonParseError.IllegalUTF8String

An illegal UTF8 sequence occurred in the input

QJsonParseError.UnterminatedString

A string wasn’t terminated with a quote

QJsonParseError.MissingObject

An object was expected but couldn’t be found

QJsonParseError.DeepNesting

The JSON document is too deeply nested for the parser to parse it

QJsonParseError.DocumentTooLarge

The JSON document is too large for the parser to parse it

QJsonParseError.GarbageAtEnd

The parsed document contains additional garbage characters at the end

Contains the type of the parse error. Is equal to NoError if the document was parsed correctly.

See also

ParseError errorString()

Contains the byte offset in the UTF-8 byte array where the parse error occurred.

See also

error errorString() fromJson()