private void abortOperation()

in curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java [510:559]


    private void abortOperation(OperationAndData<?> operation, Throwable e) {
        if (operation.getCallback() == null) {
            return;
        }
        CuratorEvent event;
        if (e instanceof KeeperException) {
            event = new CuratorEventImpl(
                    this,
                    operation.getEventType(),
                    ((KeeperException) e).code().intValue(),
                    ((KeeperException) e).getPath(),
                    null,
                    operation.getContext(),
                    null,
                    null,
                    null,
                    null,
                    null,
                    null);
        } else if (getState() == CuratorFrameworkState.STARTED) {
            event = new CuratorEventImpl(
                    this,
                    operation.getEventType(),
                    KeeperException.Code.SYSTEMERROR.intValue(),
                    null,
                    null,
                    operation.getContext(),
                    null,
                    null,
                    null,
                    null,
                    null,
                    null);
        } else {
            event = new CuratorEventImpl(
                    this,
                    operation.getEventType(),
                    KeeperException.Code.SESSIONEXPIRED.intValue(),
                    null,
                    null,
                    operation.getContext(),
                    null,
                    null,
                    null,
                    null,
                    null,
                    null);
        }
        sendToBackgroundCallback(operation, event);
    }