If you want to create you own exception, you can do:
//create a new Exception class
public class ConnectionException extends Exception {
public ConnectionException(String message){
super(message);
}
}
In your makeHttpRequest method
if(no connection) { //check connection
throw new ConnectionException ("No connection!");
} else { ... }
Finally, and try-catch block
try {
JSONObject json = jParser.makeHttpRequest(url_list_rs, "GET",
params);
catch(ConnectionException ex) {
ex.printStackTrace();
}
Note: I am not sure if this is the best practice.