Class ErrorMessageSanitizer


  • public class ErrorMessageSanitizer
    extends Object
    This class can be used to replace some paths in error messages with another string. This class is not thread safe.
    • Constructor Detail

      • ErrorMessageSanitizer

        public ErrorMessageSanitizer​(@NotNull
                                     String path,
                                     @NotNull
                                     String replacement)
        Creates sanitizer with path to sanitize.
        Parameters:
        path - path to remove from messages
        replacement - replacement for removed path
    • Method Detail

      • addSanitizedPath

        public void addSanitizedPath​(@NotNull
                                     String path,
                                     @NotNull
                                     String replacement)
        Registers new path to sanitize.
        Parameters:
        path - path to remove from messages
        replacement - replacement for removed path
      • sanitize

        public String sanitize​(@Nullable
                               String message)