Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public class JSONParseException

  1. Object
  2. Throwable
  3. Exception
  4. IOException
  5. JSONParseException
Thrown by JSONParser.parseStrict(String) and its overloads for a document that is not JSON, carrying where in the text reading stopped.

Constructors

public JSONParseException(String message, int offset)Creates the exception.

Methods

public int getOffset()The character offset in the document at which the error was found.

Inherited methods

Constructor details

JSONParseException

public JSONParseException(String message, int offset)
Creates the exception.

Parameters

message String
what was wrong
offset int
the character offset at which it was found, or -1

Method details

getOffset

public int getOffset()
The character offset in the document at which the error was found.

Returns

the offset, or -1 when no single position applies