if (cx.targetException().equals(ec)) { ExceptionHandler h = cx.targetCatchHandler().newInstance(); h.handleException(e); break;
@Override public void handleError(Throwable t) { if(t instanceof AmqpConnectException) { LOG.error("AMQP Connection error, marking this connection as failed"); onClose(null); } getExceptionHandler().handleException(t); } };
@Override public void handleError(Throwable t) { if(t instanceof AmqpConnectException) { LOG.error("AMQP Connection error, marking this connection as failed"); onClose(null); } getExceptionHandler().handleException(t); } };
public void run() { try { readFromStream(); } catch (InterruptedException e) { // we are closing down so ignore } catch (Exception e) { getExceptionHandler().handleException(e); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { // only close if we are still allowed to run if (consumer.isRunAllowed()) { // let the exception handler deal with it consumer.getExceptionHandler().handleException("Closing channel as an exception was thrown from Netty", cause); // close channel in case an exception was thrown NettyHelper.close(ctx.channel()); } }
@Override public void eventReceived(io.fabric8.kubernetes.client.Watcher.Action action, HorizontalPodAutoscaler resource) { HPAEvent hpae = new HPAEvent(action, resource); Exchange exchange = getEndpoint().createExchange(); exchange.getIn().setBody(hpae.getHpa()); exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION, hpae.getAction()); exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_EVENT_TIMESTAMP, System.currentTimeMillis()); try { processor.process(exchange); } catch (Exception e) { getExceptionHandler().handleException("Error during processing", exchange, e); } }
@Override public void eventReceived(io.fabric8.kubernetes.client.Watcher.Action action, ReplicationController resource) { ReplicationControllerEvent rce = new ReplicationControllerEvent(action, resource); Exchange exchange = getEndpoint().createExchange(); exchange.getIn().setBody(rce.getReplicationController()); exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION, rce.getAction()); exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_EVENT_TIMESTAMP, System.currentTimeMillis()); try { processor.process(exchange); } catch (Exception e) { getExceptionHandler().handleException("Error during processing", exchange, e); } }
@Override public void message(PubNub pubnub, PNMessageResult message) { Exchange exchange = endpoint.createExchange(); Message inmessage = exchange.getIn(); inmessage.setBody(message); inmessage.setHeader(TIMETOKEN, message.getTimetoken()); inmessage.setHeader(CHANNEL, message.getChannel()); try { getProcessor().process(exchange); } catch (Exception e) { getExceptionHandler().handleException("Error processing exchange", exchange, e); } }
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
public void done(boolean doneSync) { if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } });
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent exceptionEvent) throws Exception { // only close if we are still allowed to run if (consumer.isRunAllowed()) { // let the exception handler deal with it consumer.getExceptionHandler().handleException("Closing channel as an exception was thrown from Netty", exceptionEvent.getCause()); // close channel in case an exception was thrown NettyHelper.close(exceptionEvent.getChannel()); } }
private void sendEvent(Exchange exchange) { try { getProcessor().process(exchange); } catch (Exception e) { exchange.setException(e); } finally { // log exception if an exception occurred and was not handled if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); } } }
private void processSynchronously(final Exchange exchange, final ChannelHandlerContext ctx, final Object message) { try { consumer.getProcessor().process(exchange); if (consumer.getConfiguration().isSync()) { sendResponse(message, ctx, exchange); } } catch (Throwable e) { consumer.getExceptionHandler().handleException(e); } finally { consumer.doneUoW(exchange); } }
private void processSynchronously(final Exchange exchange, final MessageEvent messageEvent) { try { consumer.getProcessor().process(exchange); if (consumer.getConfiguration().isSync()) { sendResponse(messageEvent, exchange); } } catch (Throwable e) { consumer.getExceptionHandler().handleException(e); } finally { consumer.doneUoW(exchange); } }
@Override public void intercept(MessageRouter messageRouter, CommandMessage message) { Exchange exchange = getEndpoint().createExchange(ExchangePattern.InOnly); exchange.setIn(message); try { getProcessor().process(exchange); } catch (Exception e) { exchange.setException(e); } if (exchange.getException() != null) { getExceptionHandler().handleException("Error processing intercepted message: " + message, exchange, exchange.getException()); } }