@Override public void handleException(Exception e, Logger log, String name) { if (getException(NoSuchComponentException.class, e) != null) { // if the caused error is NoSuchComponentException then that can be expected so ignore } else if (getException(ComponentDefinitionException.class, e) != null) { LOG.warn("Problem looking up bean: " + name + " due: " + e.getMessage(), e); } else { LOG.trace("Ignored error looking up bean: " + name + " due: " + e.getMessage(), e); } } });
@Override public void handleException(String message, Exchange exchange, Throwable exception) { try { String msg = CamelExchangeException.createExceptionMessage(message, exchange, exception); boolean closed = ObjectHelper.getException(ClosedChannelException.class, exception) != null; if (closed) { logger.log(msg, exception, closedLoggingLevel); } else { logger.log(msg, exception); } } catch (Throwable e) { // the logging exception handler must not cause new exceptions to occur } }
@Override public void handleException(String message, Exchange exchange, Throwable exception) { try { String msg = CamelExchangeException.createExceptionMessage(message, exchange, exception); boolean closed = ObjectHelper.getException(ClosedChannelException.class, exception) != null; if (closed) { logger.log(msg, exception, closedLoggingLevel); } else { logger.log(msg, exception); } } catch (Throwable e) { // the logging exception handler must not cause new exceptions to occur } }
@Override protected boolean ignoreCannotRetrieveFile(String name, Exchange exchange, Exception cause) { if (getEndpoint().getConfiguration().isIgnoreFileNotFoundOrPermissionError()) { SftpException sftp = ObjectHelper.getException(SftpException.class, cause); if (sftp != null) { return sftp.id == ChannelSftp.SSH_FX_NO_SUCH_FILE || sftp.id == ChannelSftp.SSH_FX_PERMISSION_DENIED; } } return super.ignoreCannotRetrieveFile(name, exchange, cause); }
@Override protected boolean ignoreCannotRetrieveFile(String name, Exchange exchange, Exception cause) { if (getEndpoint().getConfiguration().isIgnoreFileNotFoundOrPermissionError()) { if (exchange != null) { // error code 550 is file not found int code = exchange.getIn().getHeader(FtpConstants.FTP_REPLY_CODE, 0, int.class); if (code == 550) { return true; } } if (cause instanceof GenericFileOperationFailedException) { GenericFileOperationFailedException generic = ObjectHelper.getException(GenericFileOperationFailedException.class, cause); //exchange is null and cause has the reason for failure to read directories if (generic.getCode() == 550) { return true; } } } return super.ignoreCannotRetrieveFile(name, exchange, cause); }
} catch (Exception e) { UnsupportedEncodingException uee = ObjectHelper.getException(UnsupportedEncodingException.class, e); if (uee != null) { LOG.debug("Unsupported encoding detected: {}", uee.getMessage());