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
FieldsModifier and TypeFieldDescriptionprotected ExceptionCodeProviderprotected ExceptionCodeProviderprotected static final CommandLoggerstatic final intstatic final intFields inherited from class org.camunda.bpm.engine.impl.interceptor.CommandInterceptor
next -
Constructor Summary
ConstructorsConstructorDescriptionExceptionCodeInterceptor(ExceptionCodeProvider builtinExceptionCodeProvider, ExceptionCodeProvider customExceptionCodeProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleancodeReserved(Integer code) <T> Tprotected IntegerprovideCode(ProcessEngineException pex, int initialCode) protected IntegerprovideCodeBySupplier(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 IntegertryResetReservedCode(Integer code) Resets codes to theBuiltinExceptionCode.FALLBACKin case they are <MIN_CUSTOM_CODEor >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
disableBuiltInExceptionCodeProviderflag inProcessEngineConfigurationImplis configured totrue, custom provider can override reserved codes. -
provideCode
-
tryResetReservedCode
Resets codes to theBuiltinExceptionCode.FALLBACKin case they are <MIN_CUSTOM_CODEor >MAX_CUSTOM_CODE. No log is written when code isBuiltinExceptionCode.FALLBACK. -
codeReserved
-
assignCodeToException
-