class EffectHandlerException extends ConnectionException {

  public static EffectHandlerException in(Object effectHandler, Throwable cause) {
    EffectHandlerException e = new EffectHandlerException(cause);

    final StackTraceElement[] stackTrace = e.getStackTrace();

    // add a synthetic StackTraceElement so that the effect handler class name will be reported in
    // the exception. This helps troubleshooting where the issue originated from.
    stackTrace[0] = new StackTraceElement(effectHandler.getClass().getName(), "apply", null, -1);

    e.setStackTrace(stackTrace);

    return e;
  }

  private  EffectHandlerException(Throwable throwable);

}