Class PersonaBasedErrorTransformStrategy
java.lang.Object
org.apache.druid.common.exception.PersonaBasedErrorTransformStrategy
- All Implemented Interfaces:
ErrorResponseTransformStrategy
public class PersonaBasedErrorTransformStrategy
extends Object
implements ErrorResponseTransformStrategy
ErrorResponseTransformStrategy that modifies the error message of a DruidException based on the
persona. For non-user error messages, this logs the exception with a randomly generated id and returns a new exception
containing the id instead.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn a function for checking and transforming the error message if needed.inthashCode()maybeTransform(DruidException druidException, Optional<String> optionalErrorId) Transforms theDruidExceptionif required.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.common.exception.ErrorResponseTransformStrategy
transformIfNeeded
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PersonaBasedErrorTransformStrategy
public PersonaBasedErrorTransformStrategy()
-
-
Method Details
-
maybeTransform
public Optional<Exception> maybeTransform(DruidException druidException, Optional<String> optionalErrorId) Transforms theDruidExceptionif required. Returns an optional with a new Druid exception if the exception was modified. Returns an empty optional if no transformation was performed.- Specified by:
maybeTransformin interfaceErrorResponseTransformStrategy
-
getErrorMessageTransformFunction
Description copied from interface:ErrorResponseTransformStrategyReturn 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.- Specified by:
getErrorMessageTransformFunctionin interfaceErrorResponseTransformStrategy
-
equals
-
hashCode
public int hashCode()
-