JsonDataException

class JsonDataException : RuntimeException

Thrown when the data in a JSON document doesn't match the data expected by the caller. For example, suppose the application expects a boolean but the JSON document contains a string. When the call to nextBoolean is made, a JsonDataException is thrown.

Exceptions of this type should be fixed by either changing the application code to accept the unexpected JSON, or by changing the JSON to conform to the application's expectations.

This exception may also be triggered if a document's nesting exceeds 31 levels. This depth is sufficient for all practical applications, but shallow enough to avoid uglier failures like StackOverflowError.

Constructors

Link copied to clipboard
open fun JsonDataException()
Link copied to clipboard
open fun JsonDataException(@Nullable message: String)
Link copied to clipboard
open fun JsonDataException(@Nullable cause: Throwable)
Link copied to clipboard
open fun JsonDataException(@Nullable message: String, @Nullable cause: Throwable)

Functions

Link copied to clipboard
fun addSuppressed(exception: Throwable)
Link copied to clipboard
open fun fillInStackTrace(): Throwable
Link copied to clipboard
open fun getLocalizedMessage(): String
Link copied to clipboard
open fun getMessage(): String
Link copied to clipboard
fun getSuppressed(): Array<Throwable>
Link copied to clipboard
open fun initCause(cause: Throwable): Throwable
Link copied to clipboard
open fun printStackTrace()
Link copied to clipboard
open fun toString(): String

Properties

Link copied to clipboard
open val cause: Throwable
Link copied to clipboard
open var stackTrace: Array<StackTraceElement>