@Override public String getFailureDescription() { String responseStr = ""; if (cause != null) { if (description != null) { responseStr = description + " - cause "; } responseStr += cause.getClass().getSimpleName() + ": " + cause.getMessage(); if (cause instanceof DittoRuntimeException) { responseStr += " / " + ((DittoRuntimeException) cause).getDescription().orElse(""); } } else if (description != null) { responseStr = description; } else { responseStr = "unknown failure"; } responseStr += " at " + time; return responseStr; }
@Override public String getFailureDescription() { String responseStr = ""; if (cause != null) { if (description != null) { responseStr = description + " - cause "; } responseStr += cause.getClass().getSimpleName() + ": " + cause.getMessage(); if (cause instanceof DittoRuntimeException) { responseStr += " / " + ((DittoRuntimeException) cause).getDescription().orElse(""); } } else if (description != null) { responseStr = description; } else { responseStr = "unknown failure"; } responseStr += " at " + time; return responseStr; }
private Optional<ExternalMessage> mapToExternalMessage(final Signal<?> signal) { try { return processor.process(signal); } catch (final DittoRuntimeException e) { log.info("Got DittoRuntimeException during processing Signal: {} - {}", e.getMessage(), e.getDescription().orElse("")); } catch (final Exception e) { log.warning("Got unexpected exception during processing Signal: {}", e.getMessage()); } return Optional.empty(); }
private Optional<ExternalMessage> mapToExternalMessage(final Signal<?> signal) { try { return processor.process(signal); } catch (final DittoRuntimeException e) { log.info("Got DittoRuntimeException during processing Signal: {} - {}", e.getMessage(), e.getDescription().orElse("")); } catch (final Exception e) { log.warning("Got unexpected exception during processing Signal: {}", e.getMessage()); } return Optional.empty(); }
private CompletionStage<Status.Status> testMessageMappingProcessor(@Nullable final MappingContext mappingContext) { try { // this one throws DittoRuntimeExceptions when the mapper could not be configured MessageMappingProcessor.of(connectionId(), mappingContext, getContext().getSystem(), log); return CompletableFuture.completedFuture(new Status.Success("mapping")); } catch (final DittoRuntimeException dre) { log.info("Got DittoRuntimeException during initialization of MessageMappingProcessor: {} {} - desc: {}", dre.getClass().getSimpleName(), dre.getMessage(), dre.getDescription().orElse("")); getSender().tell(dre, getSelf()); return CompletableFuture.completedFuture(new Status.Failure(dre)); } }
private CompletionStage<Status.Status> testMessageMappingProcessor(@Nullable final MappingContext mappingContext) { try { // this one throws DittoRuntimeExceptions when the mapper could not be configured MessageMappingProcessor.of(connectionId(), mappingContext, getContext().getSystem(), log); return CompletableFuture.completedFuture(new Status.Success("mapping")); } catch (final DittoRuntimeException dre) { log.info("Got DittoRuntimeException during initialization of MessageMappingProcessor: {} {} - desc: {}", dre.getClass().getSimpleName(), dre.getMessage(), dre.getDescription().orElse("")); getSender().tell(dre, getSelf()); return CompletableFuture.completedFuture(new Status.Failure(dre)); } }
public DittoRuntimeAssert hasDescription(final String expectedDescription) { isNotNull(); final Optional<String> actualDescriptionOptional = actual.getDescription(); assertThat(actualDescriptionOptional).contains(expectedDescription); return this; }
private void handleDittoRuntimeException(final DittoRuntimeException exception, final Map<String, String> dittoHeaders) { final ThingErrorResponse errorResponse = ThingErrorResponse.of(exception, DittoHeaders.newBuilder(exception.getDittoHeaders()) .putHeaders(dittoHeaders) .build()); enhanceLogUtil(exception); final String stackTrace = stackTraceAsString(exception); log.info("Got DittoRuntimeException '{}' when ExternalMessage was processed: {} - {}. StackTrace: {}", exception.getErrorCode(), exception.getMessage(), exception.getDescription().orElse(""), stackTrace); handleCommandResponse(errorResponse); }
private void handleDittoRuntimeException(final DittoRuntimeException exception, final Map<String, String> dittoHeaders) { final ThingErrorResponse errorResponse = ThingErrorResponse.of(exception, DittoHeaders.newBuilder(exception.getDittoHeaders()) .putHeaders(dittoHeaders) .build()); enhanceLogUtil(exception); final String stackTrace = stackTraceAsString(exception); log.info("Got DittoRuntimeException '{}' when ExternalMessage was processed: {} - {}. StackTrace: {}", exception.getErrorCode(), exception.getMessage(), exception.getDescription().orElse(""), stackTrace); handleCommandResponse(errorResponse); }
log.info( "Got DittoRuntimeException during initialization of MessageMappingProcessor: {} {} - desc: {}", dre.getClass().getSimpleName(), dre.getMessage(), dre.getDescription().orElse("")); return Left.apply(dre);
log.info( "Got DittoRuntimeException during initialization of MessageMappingProcessor: {} {} - desc: {}", dre.getClass().getSimpleName(), dre.getMessage(), dre.getDescription().orElse("")); return Left.apply(dre);