Interface StackTraceFilterer

  • All Known Implementing Classes:
    DefaultStackTraceFilterer

    public interface StackTraceFilterer
    Improves the output of stack traces produced by exceptions in a Grails application.
    Since:
    2.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addInternalPackage​(java.lang.String name)
      Adds a package name that should be filtered
      java.lang.Throwable filter​(java.lang.Throwable source)
      Remove all apparently Grails-internal trace entries from the exception instance
      java.lang.Throwable filter​(java.lang.Throwable source, boolean recursive)
      Remove all apparently Grails-internal trace entries from the exception instance
      void setCutOffPackage​(java.lang.String cutOffPackage)
      Sets the package where the stack trace should end
      void setShouldFilter​(boolean shouldFilter)  
    • Field Detail

      • FULL_STACK_TRACE_MESSAGE

        static final java.lang.String FULL_STACK_TRACE_MESSAGE
        See Also:
        Constant Field Values
      • SYS_PROP_DISPLAY_FULL_STACKTRACE

        static final java.lang.String SYS_PROP_DISPLAY_FULL_STACKTRACE
        See Also:
        Constant Field Values
    • Method Detail

      • addInternalPackage

        void addInternalPackage​(java.lang.String name)
        Adds a package name that should be filtered
        Parameters:
        name - The name of the package
      • setCutOffPackage

        void setCutOffPackage​(java.lang.String cutOffPackage)
        Sets the package where the stack trace should end
        Parameters:
        cutOffPackage - The cut off package
      • filter

        java.lang.Throwable filter​(java.lang.Throwable source,
                                   boolean recursive)

        Remove all apparently Grails-internal trace entries from the exception instance

        This modifies the original instance and returns it, it does not clone

        Parameters:
        source - The source exception
        recursive - Whether to recursively filter the cause
        Returns:
        The exception passed in, after cleaning the stack trace
      • filter

        java.lang.Throwable filter​(java.lang.Throwable source)

        Remove all apparently Grails-internal trace entries from the exception instance

        This modifies the original instance and returns it, it does not clone

        Parameters:
        source - The source exception
        Returns:
        The exception passed in, after cleaning the stack trace
      • setShouldFilter

        void setShouldFilter​(boolean shouldFilter)
        Parameters:
        shouldFilter - Whether to filter stack traces or not