Customize

If you have specific requirements in how to identify exceptions and how to structure your error and exception codes, you have to customize the de.smartics.exceptions.ExceptionContext.

This context provides all customizable information.

Custom Exception Context

The basic element of the configuration is the the factory for creating exception identifiers.

public interface ExceptionContext {
  /**
   * Returns the configuration to control the handling of throwables.
   *
   * @return the configured mode.
   */
  ThrowableHandleMode getThrowableHandleMode();

  /**
   * Returns the factory for generating identifiers.
   *
   * @return the factory for generating identifiers.
   */
  IdFactory getIdFactory();
}

To provide a custom implementations for exception context you may consider to extend de.smartics.exceptions.context.AbstractExceptionContext .

Custom Exception Identifier

To provide a custom implementations for exception identifiers you have to provide an de.smartics.exceptions.core.IdFactory and configure it with your ExceptionContext implementation.