use of org.mule.runtime.api.exception.MuleException in project mule by mulesoft.
the class AbstractAsyncRequestReplyRequester method retrieveEvent.
private PrivilegedEvent retrieveEvent(String correlationId) throws MuleException {
MultipleRequestReplierEvent multipleEvent = (MultipleRequestReplierEvent) store.retrieve(correlationId);
PrivilegedEvent event = multipleEvent.getEvent();
// TODO MULE-10302 remove this.
if (currentMuleContext.get() == null) {
try {
DeserializationPostInitialisable.Implementation.init(event, muleContext);
} catch (Exception e) {
throw new DefaultMuleException(e);
}
}
return event;
}
use of org.mule.runtime.api.exception.MuleException in project mule by mulesoft.
the class AbstractExceptionListener method resolveExceptionAndMessageToLog.
protected Pair<MuleException, String> resolveExceptionAndMessageToLog(Throwable t) {
MuleException muleException = getRootMuleException(t);
String logMessage = null;
if (muleException != null) {
if (!isVerboseExceptions() && t instanceof EventProcessingException && ((EventProcessingException) t).getEvent().getError().map(e -> CORE_NAMESPACE_NAME.equals(e.getErrorType().getNamespace()) && UNKNOWN_ERROR_IDENTIFIER.equals(e.getErrorType().getIdentifier())).orElse(false)) {
logMessage = ((MuleException) sanitize(muleException)).getVerboseMessage();
} else {
logMessage = muleException.getDetailedMessage();
}
}
return new Pair<>(muleException, logMessage);
}
use of org.mule.runtime.api.exception.MuleException in project mule by mulesoft.
the class AbstractMessageProcessorChain method start.
@Override
public void start() throws MuleException {
List<Processor> startedProcessors = new ArrayList<>();
try {
for (Processor processor : getMessageProcessorsForLifecycle()) {
if (processor instanceof Startable) {
((Startable) processor).start();
startedProcessors.add(processor);
}
}
} catch (MuleException e) {
stopIfNeeded(getMessageProcessorsForLifecycle());
throw e;
}
}
use of org.mule.runtime.api.exception.MuleException in project mule by mulesoft.
the class AbstractMessageProcessorChain method initialise.
@Override
public void initialise() throws InitialisationException {
processorInterceptorManager.getInterceptorFactories().stream().forEach(interceptorFactory -> {
ReactiveInterceptorAdapter reactiveInterceptorAdapter = new ReactiveInterceptorAdapter(interceptorFactory);
try {
muleContext.getInjector().inject(reactiveInterceptorAdapter);
} catch (MuleException e) {
throw new MuleRuntimeException(e);
}
additionalInterceptors.add(0, reactiveInterceptorAdapter);
});
processorInterceptorManager.getInterceptorFactories().stream().forEach(interceptorFactory -> {
ReactiveAroundInterceptorAdapter reactiveInterceptorAdapter = new ReactiveAroundInterceptorAdapter(interceptorFactory);
try {
muleContext.getInjector().inject(reactiveInterceptorAdapter);
} catch (MuleException e) {
throw new MuleRuntimeException(e);
}
additionalInterceptors.add(0, reactiveInterceptorAdapter);
});
initialiseIfNeeded(getMessageProcessorsForLifecycle(), muleContext);
}
use of org.mule.runtime.api.exception.MuleException in project mule by mulesoft.
the class CompositeRoutingException method getDetailedMessage.
@Override
public String getDetailedMessage() {
StringBuilder builder = new StringBuilder();
builder.append(MESSAGE_TITLE).append(lineSeparator());
for (Entry<String, Error> entry : routingResult.getFailures().entrySet()) {
String routeSubtitle = String.format("Route %s: ", entry.getKey());
MuleException muleException = ExceptionHelper.getRootMuleException(entry.getValue().getCause());
if (muleException != null) {
builder.append(routeSubtitle).append(muleException.getDetailedMessage());
} else {
builder.append(routeSubtitle).append("Caught exception in Exception Strategy: " + entry.getValue().getCause().getMessage());
}
}
return builder.toString();
}
Aggregations