[
https://issues.apache.org/jira/browse/HDFS-3516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295939#comment-13295939
]
Tsz Wo (Nicholas), SZE commented on HDFS-3516:
----------------------------------------------
For errors, the Java library sends the error message using error stream. So
using error stream works well in practice. Also, this is implementation
details and not to do with the WebHDFS API spec. (I guess you mean WebHDFS spec
by docs. Or do you mean Java API doc?)
I think it does not make sense to fall back to input stream (I believe you mean
input stream by output stream) since the error messages won't be there. Say,
there is funny bug that the op expects 307 TEMPORARY_REDIRECT but the server
returns 200 OK with a JSON or HTML response. Then, it does not make sense to
print out the response from input steam as error message.
> Check content-type in WebHdfsFileSystem
> ---------------------------------------
>
> Key: HDFS-3516
> URL: https://issues.apache.org/jira/browse/HDFS-3516
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: hdfs client
> Reporter: Tsz Wo (Nicholas), SZE
> Assignee: Tsz Wo (Nicholas), SZE
> Attachments: h3516_20120607.patch, h3516_20120608.patch,
> h3516_20120609.patch
>
>
> WebHdfsFileSystem currently tries to parse the response as json. It may be a
> good idea to check the content-type before parsing it.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira