hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [20/50] [abbrv] hadoop git commit: HADOOP-12906. AuthenticatedURL should convert a 404/Not Found into an FileNotFoundException. (Steve Loughran via gtcarrera9)
Date Fri, 11 Mar 2016 22:22:38 GMT
HADOOP-12906. AuthenticatedURL should convert a 404/Not Found into an FileNotFoundException.
(Steve Loughran via gtcarrera9)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9a79b738
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9a79b738
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9a79b738

Branch: refs/heads/HDFS-7240
Commit: 9a79b738c582bd84727831987b845535625d75fe
Parents: d49cfb3
Author: Li Lu <gtcarrera9@apache.org>
Authored: Thu Mar 10 11:38:31 2016 -0800
Committer: Li Lu <gtcarrera9@apache.org>
Committed: Thu Mar 10 11:38:31 2016 -0800

----------------------------------------------------------------------
 .../security/authentication/client/AuthenticatedURL.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9a79b738/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
index c50a516..f87d9d8 100644
--- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
+++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
@@ -15,6 +15,7 @@ package org.apache.hadoop.security.authentication.client;
 
 import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.URL;
@@ -269,10 +270,15 @@ public class AuthenticatedURL {
           }
         }
       }
+    } else if (respCode == HttpURLConnection.HTTP_NOT_FOUND) {
+      token.set(null);
+      throw new FileNotFoundException(conn.getURL().toString());
     } else {
       token.set(null);
-      throw new AuthenticationException("Authentication failed, status: " + conn.getResponseCode()
+
-                                        ", message: " + conn.getResponseMessage());
+      throw new AuthenticationException("Authentication failed" +
+          ", URL: " + conn.getURL() +
+          ", status: " + conn.getResponseCode() +
+          ", message: " + conn.getResponseMessage());
     }
   }
 


Mime
View raw message