bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evan...@apache.org
Subject [bigtop] branch master updated: URLConnection check fails with exception when it should return false (#490)
Date Sun, 10 Mar 2019 18:00:01 GMT
This is an automated email from the ASF dual-hosted git repository.

evansye pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new 1406009  URLConnection check fails with exception when it should return false (#490)
1406009 is described below

commit 14060095a1162307ef84fd9b6f6a6d73ba8c2b28
Author: foscraig <foscraig@amazon.com>
AuthorDate: Sun Mar 10 10:59:56 2019 -0700

    URLConnection check fails with exception when it should return false (#490)
---
 packages.gradle | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/packages.gradle b/packages.gradle
index b6f5985..202aa9d 100644
--- a/packages.gradle
+++ b/packages.gradle
@@ -61,8 +61,12 @@ def touchTargetFile = { fileName ->
 def ifExists = { url ->
   if (url == null) return
   URLConnection uCon = new URL(url).openConnection()
-  return (uCon as HttpURLConnection).responseCode == 200
-}
+  try {
+    return (uCon as HttpURLConnection).responseCode == 200
+  } catch(Exception e) {
+    return false
+  }
+}    
 def safeDelete = { fileName ->
   exec {
     workingDir '.'


Mime
View raw message