Interface ExceptionCodeProvider


  • public interface ExceptionCodeProvider

    One of the provider methods are called when a ProcessEngineException occurs. The default implementation provides the built-in exception codes.

    You can disable the built-in or/and additionally register a custom provider via the ProcessEngineConfigurationImpl using the following properties:

    • disableExceptionCode - disables the whole feature
    • disableBuiltinExceptionCodeProvider - only disables the built-in provider and allows overriding reserved exception codes
    • customExceptionCodeProvider - provide custom exception codes
    • Method Detail

      • provideCode

        default java.lang.Integer provideCode​(ProcessEngineException processEngineException)

        Called when a ProcessEngineException occurs.

        Provides the exception code that can be determined based on the passed ProcessEngineException. Only called when no other provider method is called.

        Parameters:
        processEngineException - that occurred.
        Returns:
        an integer value representing the error code. When returning null, the BuiltinExceptionCode.FALLBACK gets assigned to the exception.
      • provideCode

        default java.lang.Integer provideCode​(java.sql.SQLException sqlException)

        Called when a SQLException occurs.

        Provides the exception code that can be determined based on the passed SQLException. The error code is assigned to the top level ProcessEngineException. Only called when no other provider method is called.

        Parameters:
        sqlException - that occurred.
        Returns:
        an integer value representing the error code. When returning null, the BuiltinExceptionCode.FALLBACK gets assigned to the exception.