use of org.mule.runtime.core.api.connector.ConnectException in project mule by mulesoft.
the class AbstractSystemExceptionStrategy method handleException.
@Override
public void handleException(Exception ex, RollbackSourceCallback rollbackMethod) {
fireNotification(ex, getCurrentEvent());
resolveAndLogException(ex);
logger.debug("Rolling back transaction");
rollback(ex, rollbackMethod);
ExceptionPayload exceptionPayload = new DefaultExceptionPayload(ex);
if (getCurrentEvent() != null) {
PrivilegedEvent currentEvent = getCurrentEvent();
currentEvent = PrivilegedEvent.builder(currentEvent).message(InternalMessage.builder(currentEvent.getMessage()).exceptionPayload(exceptionPayload).build()).build();
setCurrentEvent(currentEvent);
}
if (ex instanceof ConnectException) {
((ConnectException) ex).handleReconnection(retryScheduler);
}
}
use of org.mule.runtime.core.api.connector.ConnectException in project mule by mulesoft.
the class AbstractLifecycleManager method invokePhase.
protected void invokePhase(String phase, Object object, LifecycleCallback callback) throws LifecycleException {
try {
this.lastPhaseExecuted = phase;
setExecutingPhase(phase);
callback.onTransition(phase, object);
setCurrentPhase(phase);
lastPhaseExecutionFailed = false;
}// In the case of a connection exception, trigger the reconnection strategy.
catch (ConnectException ce) {
lastPhaseExecutionFailed = true;
doOnConnectException(ce);
} catch (LifecycleException le) {
lastPhaseExecutionFailed = true;
throw le;
} catch (Exception e) {
lastPhaseExecutionFailed = true;
throw new LifecycleException(e, object);
} finally {
setExecutingPhase(null);
}
}
Aggregations