Search in sources :

Example 1 with SwitchManagerException

use of org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException in project open-kilda by telstra.

the class CreateLagPortFsm method finishedWithErrorEnter.

protected void finishedWithErrorEnter(CreateLagState from, CreateLagState to, CreateLagEvent event, CreateLagContext context) {
    removePortEntryIgnoreMissing();
    SwitchManagerException error = context.getError();
    log.error(format("Unable to create LAG %s on switch %s. Key: %s. Error: %s", request, switchId, key, error.getMessage()), error);
    carrier.errorResponse(key, error.getError(), "Error during LAG create", error.getMessage());
}
Also used : SwitchManagerException(org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)

Example 2 with SwitchManagerException

use of org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException in project open-kilda by telstra.

the class CreateLagPortFsm method afterTransitionCausedException.

@Override
protected void afterTransitionCausedException(CreateLagState fromState, CreateLagState toState, CreateLagEvent event, CreateLagContext context) {
    Throwable exception = getLastException().getTargetException();
    SwitchManagerException error;
    if (exception instanceof SwitchManagerException) {
        error = (SwitchManagerException) exception;
    } else {
        error = new SwitchManagerException(exception);
    }
    setStatus(StateMachineStatus.IDLE);
    fire(ERROR, CreateLagContext.builder().error(error).build());
}
Also used : SwitchManagerException(org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)

Example 3 with SwitchManagerException

use of org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException in project open-kilda by telstra.

the class DeleteLagPortFsm method afterTransitionCausedException.

@Override
protected void afterTransitionCausedException(DeleteLagState fromState, DeleteLagState toState, DeleteLagEvent event, DeleteLagContext context) {
    Throwable exception = getLastException().getTargetException();
    SwitchManagerException error;
    if (exception instanceof SwitchManagerException) {
        error = (SwitchManagerException) exception;
    } else {
        error = new SwitchManagerException(exception);
    }
    setStatus(StateMachineStatus.IDLE);
    fire(ERROR, DeleteLagContext.builder().error(error).build());
}
Also used : SwitchManagerException(org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)

Example 4 with SwitchManagerException

use of org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException in project open-kilda by telstra.

the class DeleteLagPortFsm method finishedWithErrorEnter.

protected void finishedWithErrorEnter(DeleteLagState from, DeleteLagState to, DeleteLagEvent event, DeleteLagContext context) {
    SwitchManagerException error = context.getError();
    log.error(format("Unable to delete LAG %s from switch %s. Key: %s. Error: %s", request, switchId, key, error.getMessage()), error);
    carrier.cancelTimeoutCallback(key);
    carrier.errorResponse(key, error.getError(), "Error during LAG delete", error.getMessage());
}
Also used : SwitchManagerException(org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)

Example 5 with SwitchManagerException

use of org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException in project open-kilda by telstra.

the class SwitchValidateFsm method finishedWithErrorEnter.

protected void finishedWithErrorEnter(SwitchValidateState from, SwitchValidateState to, SwitchValidateEvent event, SwitchValidateContext context) {
    @SuppressWarnings("ThrowableNotThrown") SwitchManagerException error = context.getError();
    log.error("Switch {} (key: {}) validation failed - {}", getSwitchId(), key, error.getMessage());
    carrier.cancelTimeoutCallback(key);
    carrier.errorResponse(key, error.getError(), error.getMessage(), "Error in switch validation");
}
Also used : SwitchManagerException(org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)

Aggregations

SwitchManagerException (org.openkilda.wfm.topology.switchmanager.error.SwitchManagerException)6