Most visited

Recently visited

Added in API level 1

JSONException

public class JSONException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ org.json.JSONException


Thrown to indicate a problem with the JSON API. Such problems include:

Although this is a checked exception, it is rarely recoverable. Most callers should simply wrap this exception in an unchecked exception and rethrow:

  public JSONArray toJSONObject() {
     try {
         JSONObject result = new JSONObject();
         ...
     } catch (JSONException e) {
         throw new RuntimeException(e);
     }
 }

Summary

Public constructors

JSONException(String s)

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

JSONException

Added in API level 1
JSONException (String s)

Parameters
s String

Hooray!