[ 
https://issues.apache.org/jira/browse/YARN-873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13712968#comment-13712968
 ] 

Xuan Gong commented on YARN-873:
--------------------------------

bq.Having a return statement in a catch/finally block is not recommended 
normally. We could print the message and re-throw the exception or simply not 
catch the exception. Also, this way the cmd line would exit with non-zero exit 
code.

I still prefer to the way "print out message, then exist" instead of the way 
"print out message then throw exception or not catch the exception" in this 
scenario. If we re-throw exception or not catch exception, it will make no 
different between we throw YarnException at 
YARNClient.getApplicationReport(unknownAppId).
If the user get the Exception, that means they need to check and debug whether 
there is anything wrong. For this case, if the users give the unknown 
application_id, they will get the message, and this is the expected action. 


                
> YARNClient.getApplicationReport(unknownAppId) returns a null report
> -------------------------------------------------------------------
>
>                 Key: YARN-873
>                 URL: https://issues.apache.org/jira/browse/YARN-873
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>    Affects Versions: 2.1.0-beta
>            Reporter: Bikas Saha
>            Assignee: Xuan Gong
>         Attachments: YARN-873.1.patch, YARN-873.2.patch, YARN-873.3.patch
>
>
> How can the client find out that app does not exist?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to