metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From merrimanr <...@git.apache.org>
Subject [GitHub] metron pull request #779: METRON-1218: Metron REST should return better erro...
Date Fri, 29 Sep 2017 12:54:39 GMT
Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/779#discussion_r141860594
  
    --- Diff: metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/RestExceptionHandler.java
---
    @@ -45,4 +45,14 @@ private HttpStatus getStatus(HttpServletRequest request) {
         }
         return HttpStatus.valueOf(statusCode);
       }
    +
    +  private String getFullMessage(Throwable ex) {
    +    String fullMessage = ex.getMessage();
    +    Throwable cause = ex.getCause();
    +    while(cause != null) {
    +      fullMessage = cause.getMessage();
    +      cause = cause.getCause();
    +    }
    +    return fullMessage;
    --- End diff --
    
    The stack trace is not shown in the UI, only the root cause.  If a user is not authenticated,
they wouldn't be see this error anyways, they would get a 401.
    
    @simonellistonball are you suggesting we move the logging call to the exception handler
instead of the offending class?  In this case it's very likely an error would get logged twice.


---

Mime
View raw message