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

Steve Loughran commented on HADOOP-12324:
-----------------------------------------

That's bad practise in those tests: we add better reporting & they break. Tests 
should, ideally
# use {{.contains()}} instead of {{.startsWith()}}
# use constant strings for error text in the source files, strings referenced 
in the test cases.

here we should change those failing tests to use the {{contains()}} probe. Or, 
do we want to be clever and so something complex like

{code}
e.getMessage()!=null? e.getMessage(): e.toString()
{code}

> Better exception reporting in SaslPlainServer
> ---------------------------------------------
>
>                 Key: HADOOP-12324
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12324
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>    Affects Versions: 2.8.0
>            Reporter: Mike Yoder
>            Assignee: Mike Yoder
>            Priority: Minor
>         Attachments: HADOOP-12324.000.patch
>
>
> This is a follow up from HADOOP-12318.  The review comment from 
> [~ste...@apache.org]:
> {quote}
> -1. It's critical to use Exception.toString() and not .getMessage(), as some 
> exceptions (NPE) don't have messages.
> {quote}
> This is the promised follow-up Jira.
> CC: [~atm]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to