diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index cd59aa8d755..fe34ab8f051 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -95,6 +95,9 @@ Release 2.4.0 - UNRELEASED HDFS-5868. Make hsync implementation pluggable on the DataNode. (Buddy Taylor via Arpit Agarwal) + HDFS-5935. New Namenode UI FS browser should throw smarter error messages. + (Travis Thompson via jing9) + OPTIMIZATIONS HDFS-5790. LeaseManager.findPath is very slow when many leases need recovery diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js index 5d802104ffd..bcce8c16b1f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js @@ -66,10 +66,23 @@ function network_error_handler(url) { return function (jqxhr, text, err) { - var msg = '

Failed to retreive data from ' + url + ', cause: ' + err + '

'; - if (url.indexOf('/webhdfs/v1') === 0) { - msg += '

WebHDFS might be disabled. WebHDFS is required to browse the filesystem.

'; - } + switch(jqxhr.status) { + case 401: + var msg = '

Authentication failed when trying to open ' + url + ': Unauthrozied.

'; + break; + case 403: + if(jqxhr.responseJSON !== undefined && jqxhr.responseJSON.RemoteException !== undefined) { + var msg = '

' + jqxhr.responseJSON.RemoteException.message + "

"; + break; + } + var msg = '

Permission denied when trying to open ' + url + ': ' + err + '

'; + break; + case 404: + var msg = '

Path does not exist on HDFS or WebHDFS is disabled. Please check your path or enable WebHDFS

'; + break; + default: + var msg = '

Failed to retreive data from ' + url + ': ' + err + '

'; + } show_err_msg(msg); }; }