public static IOException unwrapCorruption(Throwable t) { return (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); }
private static boolean isMasterChannelException(TransportException exp) { return ExceptionsHelper.unwrap(exp, MASTER_CHANNEL_EXCEPTIONS) != null; }
private static void checkRoutingMissingException(MultiTermVectorsItemResponse response) { Throwable cause = ExceptionsHelper.unwrap(response.getFailure().getCause(), RoutingMissingException.class); if (cause != null) { throw ((RoutingMissingException) cause); } }
@Override public void onFailure(Exception e) { if (ExceptionsHelper.unwrap(e, IndexNotFoundException.class) != null) { // We haven't yet created the index for the task results so it can't be found. listener.onFailure(new ResourceNotFoundException("task [{}] isn't running and hasn't stored its results", e, request.getTaskId())); } else { listener.onFailure(e); } } });
@Override public void onFailure(Exception e) { /* * We couldn't load the task from the task index. Instead of 404 we should use the snapshot we took after it finished. If * the error isn't a 404 then we'll just throw it back to the user. */ if (ExceptionsHelper.unwrap(e, ResourceNotFoundException.class) != null) { listener.onResponse(new GetTaskResponse(new TaskResult(true, snapshotOfRunningTask))); } else { listener.onFailure(e); } } });
public void updateGlobalCheckpointForShard(final ShardId shardId) { final ThreadContext threadContext = threadPool.getThreadContext(); try (ThreadContext.StoredContext ignore = threadContext.stashContext()) { threadContext.markAsSystemContext(); execute( new Request(shardId), ActionListener.wrap(r -> { }, e -> { if (ExceptionsHelper.unwrap(e, AlreadyClosedException.class, IndexShardClosedException.class) == null) { logger.info(new ParameterizedMessage("{} global checkpoint sync failed", shardId), e); } })); } }
public static IOException unwrapCorruption(Throwable t) { return (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); }
public static IOException unwrapCorruption(Throwable t) { return (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); }
public static IOException unwrapCorruption(Throwable t) { return (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); }
public static IOException unwrapCorruption(Throwable t) { return (IOException) unwrap(t, CorruptIndexException.class, IndexFormatTooOldException.class, IndexFormatTooNewException.class); }
if (ExceptionsHelper.unwrap(e, BytesRefHash.MaxBytesLengthExceededException.class) != null) {
protected final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { final Throwable unwrapped = ExceptionsHelper.unwrap(cause, ElasticsearchException.class); final Throwable t = unwrapped != null ? unwrapped : cause; Channel channel = ctx.channel(); onException(channel.attr(CHANNEL_KEY).get(), t instanceof Exception ? (Exception) t : new ElasticsearchException(t)); }
protected final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { final Throwable unwrapped = ExceptionsHelper.unwrap(cause, ElasticsearchException.class); final Throwable t = unwrapped != null ? unwrapped : cause; Channel channel = ctx.channel(); onException(channel.attr(CHANNEL_KEY).get(), t instanceof Exception ? (Exception) t : new ElasticsearchException(t)); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ExceptionsHelper.maybeDieOnAnotherThread(cause); final Throwable unwrapped = ExceptionsHelper.unwrap(cause, ElasticsearchException.class); final Throwable newCause = unwrapped != null ? unwrapped : cause; Netty4TcpChannel tcpChannel = ctx.channel().attr(Netty4Transport.CHANNEL_KEY).get(); if (newCause instanceof Error) { transport.onException(tcpChannel, new Exception(newCause)); } else { transport.onException(tcpChannel, (Exception) newCause); } }
private static void checkRoutingMissingException(MultiTermVectorsItemResponse response) { Throwable cause = ExceptionsHelper.unwrap(response.getFailure().getCause(), RoutingMissingException.class); if (cause != null) { throw ((RoutingMissingException) cause); } }
@Override public void onFailure(Exception e) { if (ExceptionsHelper.unwrap(e, IndexNotFoundException.class) != null) { // We haven't yet created the index for the task results so it can't be found. listener.onFailure(new ResourceNotFoundException("task [{}] isn't running and hasn't stored its results", e, request.getTaskId())); } else { listener.onFailure(e); } } });
@Override public void onFailure(Exception e) { if (ExceptionsHelper.unwrap(e, IndexNotFoundException.class) != null) { // We haven't yet created the index for the task results so it can't be found. listener.onFailure(new ResourceNotFoundException("task [{}] isn't running and hasn't stored its results", e, request.getTaskId())); } else { listener.onFailure(e); } } });
@Override public void onFailure(Exception e) { if (ExceptionsHelper.unwrap(e, IndexNotFoundException.class) != null) { // We haven't yet created the index for the task results so it can't be found. listener.onFailure(new ResourceNotFoundException("task [{}] isn't running and hasn't stored its results", e, request.getTaskId())); } else { listener.onFailure(e); } } });
@Override public void onFailure(Exception e) { /* * We couldn't load the task from the task index. Instead of 404 we should use the snapshot we took after it finished. If * the error isn't a 404 then we'll just throw it back to the user. */ if (ExceptionsHelper.unwrap(e, ResourceNotFoundException.class) != null) { listener.onResponse(new GetTaskResponse(new TaskResult(true, snapshotOfRunningTask))); } else { listener.onFailure(e); } } });
@Override public void onFailure(Exception e) { /* * We couldn't load the task from the task index. Instead of 404 we should use the snapshot we took after it finished. If * the error isn't a 404 then we'll just throw it back to the user. */ if (ExceptionsHelper.unwrap(e, ResourceNotFoundException.class) != null) { listener.onResponse(new GetTaskResponse(new TaskResult(true, snapshotOfRunningTask))); } else { listener.onFailure(e); } } });