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

ASF GitHub Bot commented on METRON-1218:
----------------------------------------

Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/779#discussion_r141861097
  
    --- 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 --
    
    @cestella I initially tried to include the whole stack trace in the 
response but I couldn't find a good way to format it.  Multi-line statements 
just don't work well in JSON so I settled on the root cause because it's 
usually the most important piece of information anyways.  The whole stack trace 
is logged, just not returned in the JSON response.  Any ideas on how to do this 
better?


> Metron REST should return better error messages
> -----------------------------------------------
>
>                 Key: METRON-1218
>                 URL: https://issues.apache.org/jira/browse/METRON-1218
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>
> Currently, Metron REST does not provide enough detail when an error happens.  
> For example, an error that happens in the search endpoint will simply return 
> "Could not execute search" with no detail and nothing in the metron-rest.log.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to