Interface ErrorResponseTransformStrategy

All Known Implementing Classes:
AllowedRegexErrorResponseTransformStrategy, NoErrorResponseTransformStrategy, PersonaBasedErrorTransformStrategy

public interface ErrorResponseTransformStrategy
  • Method Details

    • transformIfNeeded

      default Exception transformIfNeeded(SanitizableException exception)
      For a given SanitizableException apply the transformation strategy and return the sanitized Exception if the transformation stategy was applied.
    • maybeTransform

      default Optional<Exception> maybeTransform(DruidException exception, Optional<String> errorId)
      For a given DruidException apply the transformation strategy and return a sanitized Exception if the transformation stategy was applied. This call does not log the exception. It is the callers responsibility to do so. Returns Optional.empty() if no transformation was applied. The errorId is provided to be used in the transformed Exception if needed.
    • getErrorMessageTransformFunction

      @NotNull @NotNull Function<String,String> getErrorMessageTransformFunction()
      Return a function for checking and transforming the error message if needed. Function can return null if error message needs to be omitted or return String to be use instead.