Because the response you are getting it not properly formatted for Json conversion.
JSONObject obj = new JSONObject(response);
Its returning boolean which you are trying to convert into JSONObject.
Edit 1: It might also occur that there is problem while fetching boolean.
Try to fetch it like this:
jsonObject.optBoolean("error");