public class ExceptionUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PERSISTENCE_EXCEPTION_MESSAGE |
Constructor and Description |
---|
ExceptionUtil() |
public static final String PERSISTENCE_EXCEPTION_MESSAGE
public static String getExceptionStacktrace(ByteArrayEntity byteArray)
public static ByteArrayEntity createJobExceptionByteArray(byte[] byteArray, ResourceType type)
public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type)
name
- - type\source of the exceptionbyteArray
- - payload of the exceptiontype
- - resource type of the exceptionpublic static boolean checkValueTooLongException(ProcessEngineException exception)
public static boolean checkConstraintViolationException(ProcessEngineException exception)
public static List<SQLException> findRelatedSqlExceptions(Throwable exception)
public static boolean checkForeignKeyConstraintViolation(Throwable cause)
public static boolean checkVariableIntegrityViolation(Throwable cause)
public static org.apache.ibatis.executor.BatchExecutorException findBatchExecutorException(Throwable exception)
public static <T> T doWithExceptionWrapper(java.util.function.Supplier<T> supplier)
ProcessEngineException
and never propagated directly to an Engine API
call. In some cases, the top-level exception and its message are shown as a response body in
the REST API. Wrapping all MyBatis API calls in our codebase makes sure that the top-level
exception is always a ProcessEngineException
with a generic message. Like this, SQL
details are never disclosed to potential attackers.T
- is the type of the return valuesupplier
- which calls MyBatis APIProcessEngineException
- which wraps the actual exceptionpublic static ProcessEngineException wrapPersistenceException(Exception ex)
Copyright © 2021. All rights reserved.