You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by ev...@apache.org on 2019/03/10 18:00:01 UTC
[bigtop] branch master updated: URLConnection check fails with
exception when it should return false (#490)
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 <fo...@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 '.'