Class ExceptionCodeInterceptor
java.lang.Object
org.camunda.bpm.engine.impl.interceptor.CommandInterceptor
org.camunda.bpm.engine.impl.interceptor.ExceptionCodeInterceptor
- All Implemented Interfaces:
CommandExecutor
A command interceptor to catch ProcessEngineException
errors and assign error codes.
The interceptor assigns an error code to the ProcessEngineException
based on the built-in or custom ExceptionCodeProvider
.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ExceptionCodeProvider
protected ExceptionCodeProvider
protected static final CommandLogger
static final int
static final int
Fields inherited from class org.camunda.bpm.engine.impl.interceptor.CommandInterceptor
next
-
Constructor Summary
ConstructorDescriptionExceptionCodeInterceptor
(ExceptionCodeProvider builtinExceptionCodeProvider, ExceptionCodeProvider customExceptionCodeProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected boolean
codeReserved
(Integer code) <T> T
protected Integer
provideCode
(ProcessEngineException pex, int initialCode) protected Integer
provideCodeBySupplier
(Supplier<Integer> builtinSupplier, Supplier<Integer> customSupplier, int initialCode) Built-in code provider has precedence over custom code provider and initial code (assigned via delegation code).protected Integer
tryResetReservedCode
(Integer code) Resets codes to theBuiltinExceptionCode.FALLBACK
in case they are <MIN_CUSTOM_CODE
or >MAX_CUSTOM_CODE
.Methods inherited from class org.camunda.bpm.engine.impl.interceptor.CommandInterceptor
getNext, setNext
-
Field Details
-
LOG
-
MIN_CUSTOM_CODE
public static final int MIN_CUSTOM_CODE- See Also:
-
MAX_CUSTOM_CODE
public static final int MAX_CUSTOM_CODE- See Also:
-
builtinExceptionCodeProvider
-
customExceptionCodeProvider
-
-
Constructor Details
-
ExceptionCodeInterceptor
public ExceptionCodeInterceptor(ExceptionCodeProvider builtinExceptionCodeProvider, ExceptionCodeProvider customExceptionCodeProvider)
-
-
Method Details
-
execute
-
provideCodeBySupplier
protected Integer provideCodeBySupplier(Supplier<Integer> builtinSupplier, Supplier<Integer> customSupplier, int initialCode) Built-in code provider has precedence over custom code provider and initial code (assigned via delegation code). Custom and initial code is tried to be reset in case it violates the reserved code range.
When
disableBuiltInExceptionCodeProvider
flag inProcessEngineConfigurationImpl
is configured totrue
, custom provider can override reserved codes. -
provideCode
-
tryResetReservedCode
Resets codes to theBuiltinExceptionCode.FALLBACK
in case they are <MIN_CUSTOM_CODE
or >MAX_CUSTOM_CODE
. No log is written when code isBuiltinExceptionCode.FALLBACK
. -
codeReserved
-
assignCodeToException
-