Package org.apache.druid.common.utils
Class ServletResourceUtils
- java.lang.Object
-
- org.apache.druid.common.utils.ServletResourceUtils
-
public class ServletResourceUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ServletResourceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
jsonize(String msgFormat, Object... args)
Converts String errorMsg into a Map so that it produces valid json on serialization into response.static Map<String,String>
sanitizeException(Throwable t)
Sanitize the exception as a map of "error" to information about the exception.
-
-
-
Method Detail
-
sanitizeException
public static Map<String,String> sanitizeException(@Nullable Throwable t)
Sanitize the exception as a map of "error" to information about the exception. This method explicitly suppresses the stack trace and any other logging. Any logging should be handled by the caller.- Parameters:
t
- The exception to sanitize- Returns:
- An immutable Map with a single entry which maps "error" to information about the error suitable for passing as an entity in a servlet error response.
-
-