[jira] [Comment Edited] (HDFS-8741) Proper error msg to be printed when invalid operation type is given to WebHDFS operations

2017-03-06 Thread Yiqun Lin (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-8741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15897105#comment-15897105
 ] 

Yiqun Lin edited comment on HDFS-8741 at 3/6/17 11:09 AM:
--

Committed this to trunk and branch-2. Thanks [~surendrasingh] for the 
contribution and thanks [~ajisakaa] for the review!


was (Author: linyiqun):
Committed this to trunk and branch-2. Thanks [~surendrasingh] for the 
conreibution and thanks [~ajisakaa] for the review!

> Proper error msg to be printed when invalid operation type is given to 
> WebHDFS operations
> -
>
> Key: HDFS-8741
> URL: https://issues.apache.org/jira/browse/HDFS-8741
> Project: Hadoop HDFS
>  Issue Type: Improvement
>  Components: webhdfs
>Affects Versions: 3.0.0-alpha2
>Reporter: Archana T
>Assignee: Surendra Singh Lilhore
>Priority: Minor
> Fix For: 2.9.0, 3.0.0-alpha3
>
> Attachments: HDFS-8741.001.patch, HDFS-8741.002.patch, 
> HDFS-8741.003.patch, HDFS-8741.004.patch, HDFS-8741.005.patch
>
>
> When wrong operation type is given to WebHDFS operations, following Error 
> message is printed --
> For ex: CREATE is called with GET instead of PUT--
> HTTP/1.1 400 Bad Request
> ..
> {"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Invalid
>  value for webhdfs parameter \"op\": {color:red}No enum constant 
> org.apache.hadoop.hdfs.web.resources.PutOpParam.Op.CREATE"}}{color}
> Expected--
> Valid Error message to be printed



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDFS-8741) Proper error msg to be printed when invalid operation type is given to WebHDFS operations.

2017-03-02 Thread Yiqun Lin (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-8741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15893649#comment-15893649
 ] 

Yiqun Lin edited comment on HDFS-8741 at 3/3/17 3:13 AM:
-

Thanks [~surendrasingh] for the patch. Some comments for your test.

* It would be better to add message into {{fails()}}, like following:
{code}
+  @Test
+  public void testHttpOpParams() {
+try {
+  new PostOpParam("TEST");
+  Assert.fail("Construct the PostOpParam with param vaule 'TEST' should be 
failed.");
{code}
* Suggest using {{GenericTestUtils#assertExceptionContains}} verify the message 
contained in exception.



was (Author: linyiqun):
Thanks [~surendrasingh] for the patch. Some comments for your test.

* It would be better to add message into {{fails()}}, like following:
{code}
+  @Test
+  public void testHttpOpParams() {
+try {
+  new PostOpParam("TEST");
+  Assert.fail("Construct the PostOpParam with param vaule TEST should be 
failed.");
{code}
* Suggest using {{GenericTestUtils#assertExceptionContains}} verify the message 
contained in exception.


> Proper error msg to be printed when invalid operation type is given to 
> WebHDFS operations.
> --
>
> Key: HDFS-8741
> URL: https://issues.apache.org/jira/browse/HDFS-8741
> Project: Hadoop HDFS
>  Issue Type: Improvement
>  Components: webhdfs
>Reporter: Archana T
>Assignee: Surendra Singh Lilhore
>Priority: Minor
> Attachments: HDFS-8741.001.patch, HDFS-8741.002.patch, 
> HDFS-8741.003.patch
>
>
> When wrong operation type is given to WebHDFS operations, following Error 
> message is printed --
> For ex: CREATE is called with GET instead of PUT--
> HTTP/1.1 400 Bad Request
> ..
> {"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Invalid
>  value for webhdfs parameter \"op\": {color:red}No enum constant 
> org.apache.hadoop.hdfs.web.resources.PutOpParam.Op.CREATE"}}{color}
> Expected--
> Valid Error message to be printed



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org