Code example for ConnectException

0
		String result = null;
		try 
		{ 
			if (httpURLConnection.getResponseCode() != HttpURLConnection.HTTP_OK)
			{ 
				throw new ConnectException("检查网络连接");
			} else 
			{ 
				result = readResult(httpURLConnection);
				if (result != null)
				{ 
					JSONObject jsonObject = new JSONObject(result);
					int code = jsonObject.getInt("code");
					if (code != 0)
					{ 
						String message;
						message = jsonObject.getString("message");
						throw new SharePhotoException(message, code);
					} 
				} 
			}