今天调试网络请求部分时,当getInputStream失败时直接抛出异常。解决方法时在getInputStream之前获取ResponseCodeif( connection.getResponseCode() != HttpURLConnection.HTTP_OK) return null;