[seam-issues] [JBoss JIRA] Commented: (SEAMCATCH-4) Include the ability to filter stack traces

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri Dec 10 14:52:52 EST 2010


    [ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569366#comment-12569366 ] 

Dan Allen commented on SEAMCATCH-4:
-----------------------------------

I played around with some ideas and we may even be able to use this for the exception mapping as well. Here are some prototype APIs.

/**
 * A filter for processing the stack frames of a single exception (type parameter allows us to focus on a specific exception type)
 */
public interface ExceptionStackFrameFilter<T extends Throwable>
{
   public StackFrameFilterResult process(StackFrame frame);
}

public interface StackFrame
{
   StackElement getStackElement();
   StackTraceElement getStackTraceElement();
   void mark(String tag);
   StackFrame getMarkedFrame(String tag);
   boolean isMarkSet(String tag);
   void clearMark(String tag);
   void setStackTraceElement(StackTraceElement element);
   IterationStatus getIterationStatus();
}

public enum StackFrameFilterResult
{
   /**
    * Include this frame
    */
   INCLUDE,
   
   /**
    * Drop this frame
    */
   DROP,
   
   /**
    * Include this frame, but skip any remaining frames in this cause
    */
   DROP_REMAINING,
   
   /**
    * Drop this frame and any remaining frames in this cause
    */
   BREAK,
   
   /**
    * Stops processing any remaining frames or causes
    */
   TERMINATE,
   
   /**
    * Include this frame, then stop processing any remaining frames or causes
    */
   TERMINATE_AFTER
}

/**
 * A filter for processing the chained exceptions (i.e., the causes)
 */
public interface ExceptionStackFilter
{
   public StackFilterResult process(StackElement element);
}

public interface StackElement
{
   Throwable getThrowable();
   void setThrowable(Throwable throwable);
   IterationStatus getIterationStatus();
}

public enum StackFilterResult
{
   /**
    * Include this throwable
    */
   INCLUDE,
   
   /**
    * Drop this throwable, go to next in chain (if any)
    */
   DROP,
   
   /**
    * Drop any remaining throwables in the chain
    */
   DROP_REMAINING,
   
   /**
    * Drop throwable and any remaining in the chain
    */
   TERMINATE
}

> Include the ability to filter stack traces
> ------------------------------------------
>
>                 Key: SEAMCATCH-4
>                 URL: https://issues.jboss.org/browse/SEAMCATCH-4
>             Project: Seam Catch
>          Issue Type: Feature Request
>            Reporter: Jason Porter
>            Assignee: Jason Porter
>             Fix For: Alpha3
>
>
> Catch should support ideas such as http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-exception-info http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html and http://pastebin.com/p8aCSeuu

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list