Interface ErrorResponseTransformStrategy
- All Known Implementing Classes:
AllowedRegexErrorResponseTransformStrategy,NoErrorResponseTransformStrategy,PersonaBasedErrorTransformStrategy
public interface ErrorResponseTransformStrategy
-
Method Summary
Modifier and TypeMethodDescriptionReturn a function for checking and transforming the error message if needed.maybeTransform(DruidException exception, Optional<String> errorId) For a givenDruidExceptionapply the transformation strategy and return a sanitized Exception if the transformation stategy was applied.default ExceptiontransformIfNeeded(SanitizableException exception) For a givenSanitizableExceptionapply the transformation strategy and return the sanitized Exception if the transformation stategy was applied.
-
Method Details
-
transformIfNeeded
For a givenSanitizableExceptionapply the transformation strategy and return the sanitized Exception if the transformation stategy was applied. -
maybeTransform
For a givenDruidExceptionapply 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
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.
-