HDFS-7785. Improve diagnostics information for HttpPutFailedException. Contributed by Chengbing Liu.

This commit is contained in:
Haohui Mai 2015-03-02 15:35:02 -08:00
parent 5d0bae550f
commit c5eac9c6fe
2 changed files with 6 additions and 1 deletions

View File

@ -1064,6 +1064,9 @@ Release 2.7.0 - UNRELEASED
HDFS-6753. Initialize checkDisk when DirectoryScanner not able to get HDFS-6753. Initialize checkDisk when DirectoryScanner not able to get
files list for scanning (J.Andreina via vinayakumarb) files list for scanning (J.Andreina via vinayakumarb)
HDFS-7785. Improve diagnostics information for HttpPutFailedException.
(Chengbing Liu via wheat9)
BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS
HDFS-7720. Quota by Storage Type API, tools and ClientNameNode HDFS-7720. Quota by Storage Type API, tools and ClientNameNode

View File

@ -291,7 +291,9 @@ private static void uploadImage(URL url, Configuration conf,
int responseCode = connection.getResponseCode(); int responseCode = connection.getResponseCode();
if (responseCode != HttpURLConnection.HTTP_OK) { if (responseCode != HttpURLConnection.HTTP_OK) {
throw new HttpPutFailedException(connection.getResponseMessage(), throw new HttpPutFailedException(String.format(
"Image uploading failed, status: %d, url: %s, message: %s",
responseCode, urlWithParams, connection.getResponseMessage()),
responseCode); responseCode);
} }
} catch (AuthenticationException e) { } catch (AuthenticationException e) {