Class StackTraceSanitizer

java.lang.Object
revxrsal.commands.util.StackTraceSanitizer

public final class StackTraceSanitizer extends Object
A utility for stripping stacktraces from local paths to classes. This helps keep errors clean as well as removing unnecessary trace paths which do not help.
  • Method Details

    • sanitize

      public void sanitize(@NotNull @NotNull Throwable throwable)
      Strips all the stack trace elements that meet the criteria of any filter.
      Parameters:
      throwable - Throwable to strip
    • defaultSanitizer

      public static StackTraceSanitizer defaultSanitizer()
      Returns the default sanitizer
      Returns:
      The default stack trace sanitizer
    • empty

      public static StackTraceSanitizer empty()
      Returns the empty sanitizer
      Returns:
      A sanitizer that does not modify the trace
    • builder

      public static StackTraceSanitizer.Builder builder()