Code example for HttpResponseException

Methods: getStatusCode, printStackTrace

0
			try { 
				if (checkConnection()) 
					return mClient.execute(params[0], brh);
				return CONNECTION_ERROR + "";
			} catch (HttpResponseException e) {
				e.printStackTrace();
				int responseCode = e.getStatusCode();
				if (responseCode >= 400 && responseCode < 500)
					return responseCode + "";
			} catch (IOException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
			return ""; 
		} 
	} 
 
	/** 
	 * method for checking whether the internet connection is available. 
	 *  
	 * @return true if the connection is available and working, false otherwise