@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { logger.debug("Unhandled exception: {}", cause); sendError(ctx, ExceptionUtils.stringifyException(cause)); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { final String msg = "Exception in server pipeline. Caused by: " + ExceptionUtils.stringifyException(cause); final ByteBuf err = MessageSerializer.serializeServerFailure(ctx.alloc(), new RuntimeException(msg)); LOG.debug(msg); ctx.writeAndFlush(err).addListener(ChannelFutureListener.CLOSE); }
@Override public CompletableFuture<KvStateResponse> handleRequest(final long requestId, final KvStateInternalRequest request) { final CompletableFuture<KvStateResponse> responseFuture = new CompletableFuture<>(); try { final KvStateEntry<?, ?, ?> kvState = registry.getKvState(request.getKvStateId()); if (kvState == null) { responseFuture.completeExceptionally(new UnknownKvStateIdException(getServerName(), request.getKvStateId())); } else { byte[] serializedKeyAndNamespace = request.getSerializedKeyAndNamespace(); byte[] serializedResult = getSerializedValue(kvState, serializedKeyAndNamespace); if (serializedResult != null) { responseFuture.complete(new KvStateResponse(serializedResult)); } else { responseFuture.completeExceptionally(new UnknownKeyOrNamespaceException(getServerName())); } } return responseFuture; } catch (Throwable t) { String errMsg = "Error while processing request with ID " + requestId + ". Caused by: " + ExceptionUtils.stringifyException(t); responseFuture.completeExceptionally(new RuntimeException(errMsg)); return responseFuture; } }
this.fullStringifiedStackTrace = ExceptionUtils.stringifyException(exception);
exception.append("\nException for topic=").append(part.getTopic()) .append(" partition=").append(part.getPartition()).append(": ") .append(ExceptionUtils.stringifyException(ErrorMapping.exceptionFor(code)));
@Test public void testStringifyNullException() { assertNotNull(ExceptionUtils.STRINGIFIED_NULL_EXCEPTION); assertEquals(ExceptionUtils.STRINGIFIED_NULL_EXCEPTION, ExceptionUtils.stringifyException(null)); }
final String stringifiedCause = ExceptionUtils.stringifyException(t);
ExceptionUtils.stringifyException(ErrorMapping.exceptionFor(code));
stats.reportFailedRequest(); final String errMsg = "Failed request " + requestId + "." + System.lineSeparator() + " Caused by: " + ExceptionUtils.stringifyException(t); final ByteBuf err = MessageSerializer.serializeRequestFailure(ctx.alloc(), requestId, new RuntimeException(errMsg)); ctx.writeAndFlush(err);
@Test public void testDeSerializationError() { try { TypeInformation<DeserializeTooMuchType> info = new ValueTypeInfo<DeserializeTooMuchType>(DeserializeTooMuchType.class); FromElementsFunction<DeserializeTooMuchType> source = new FromElementsFunction<DeserializeTooMuchType>( info.createSerializer(new ExecutionConfig()), new DeserializeTooMuchType()); try { source.run(new ListSourceContext<DeserializeTooMuchType>(new ArrayList<DeserializeTooMuchType>())); fail("should fail with an exception"); } catch (IOException e) { assertTrue(ExceptionUtils.stringifyException(e).contains("user-defined serialization")); } } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Test public void testSerializationError() { try { TypeInformation<SerializationErrorType> info = new ValueTypeInfo<SerializationErrorType>(SerializationErrorType.class); try { new FromElementsFunction<SerializationErrorType>( info.createSerializer(new ExecutionConfig()), new SerializationErrorType()); fail("should fail with an exception"); } catch (IOException e) { assertTrue(ExceptionUtils.stringifyException(e).contains("test exception")); } } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
targetDirectory.getAbsolutePath()); } catch (Exception e) { String exceptionString = ExceptionUtils.stringifyException(e); if (!(exceptionString.matches("(.*\n)*.*savepoint for the job .* failed(.*\n)*") // legacy || exceptionString.matches("(.*\n)*.*was not running(.*\n)*")
byte[] bytes = ExceptionUtils.stringifyException(t).getBytes(ENCODING);
ExceptionUtils.stringifyException(exc), client.isEventGroupShutdown() );
clusterClient.submitJob(jobGraph, AbstractQueryableStateTestBase.class.getClassLoader()); } catch (ProgramInvocationException e) { String failureCause = ExceptionUtils.stringifyException(e); assertThat(failureCause, containsString("KvState with name '" + queryName + "' has already been registered by another operator")); caughtException = true;
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { final String msg = "Exception in server pipeline. Caused by: " + ExceptionUtils.stringifyException(cause); final ByteBuf err = serializer.serializeServerFailure(ctx.alloc(), new RuntimeException(msg)); LOG.debug(msg); ctx.writeAndFlush(err).addListener(ChannelFutureListener.CLOSE); }
public static HttpResponse getErrorResponse(Throwable throwable, HttpResponseStatus status) { byte[] bytes = ExceptionUtils.stringifyException(throwable).getBytes(ENCODING); FullHttpResponse response = new DefaultFullHttpResponse( HttpVersion.HTTP_1_1, status, Unpooled.wrappedBuffer(bytes)); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=" + ENCODING.name()); response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, response.content().readableBytes()); return response; } }
public static HttpResponse getErrorResponse(Throwable throwable, HttpResponseStatus status) { byte[] bytes = ExceptionUtils.stringifyException(throwable).getBytes(ENCODING); FullHttpResponse response = new DefaultFullHttpResponse( HttpVersion.HTTP_1_1, status, Unpooled.wrappedBuffer(bytes)); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=" + ENCODING.name()); response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, response.content().readableBytes()); return response; } }
public ArchivedExecution(Execution execution) { this.userAccumulators = execution.getUserAccumulatorsStringified(); this.attemptId = execution.getAttemptId(); this.attemptNumber = execution.getAttemptNumber(); this.stateTimestamps = execution.getStateTimestamps(); this.parallelSubtaskIndex = execution.getVertex().getParallelSubtaskIndex(); this.state = execution.getState(); this.failureCause = ExceptionUtils.stringifyException(execution.getFailureCause()); this.assignedResourceLocation = execution.getAssignedResourceLocation(); this.ioMetrics = execution.getIOMetrics(); }
public ArchivedExecution(Execution execution) { this.userAccumulators = execution.getUserAccumulatorsStringified(); this.attemptId = execution.getAttemptId(); this.attemptNumber = execution.getAttemptNumber(); this.stateTimestamps = execution.getStateTimestamps(); this.parallelSubtaskIndex = execution.getVertex().getParallelSubtaskIndex(); this.state = execution.getState(); this.failureCause = ExceptionUtils.stringifyException(execution.getFailureCause()); this.assignedResourceLocation = execution.getAssignedResourceLocation(); this.ioMetrics = execution.getIOMetrics(); }