|
19 | 19 |
|
20 | 20 | import javax.annotation.Nullable;
|
21 | 21 |
|
| 22 | +import org.apache.pekko.actor.AbstractExtensionId; |
| 23 | +import org.apache.pekko.actor.ActorRef; |
| 24 | +import org.apache.pekko.actor.ActorSystem; |
| 25 | +import org.apache.pekko.actor.ExtendedActorSystem; |
| 26 | +import org.apache.pekko.actor.Extension; |
| 27 | +import org.apache.pekko.cluster.pubsub.DistributedPubSubMessage; |
| 28 | +import org.apache.pekko.pattern.AskTimeoutException; |
22 | 29 | import org.eclipse.ditto.base.model.acks.DittoAcknowledgementLabel;
|
| 30 | +import org.eclipse.ditto.base.model.common.HttpStatus; |
23 | 31 | import org.eclipse.ditto.base.model.exceptions.AskException;
|
24 | 32 | import org.eclipse.ditto.base.model.exceptions.DittoInternalErrorException;
|
25 | 33 | import org.eclipse.ditto.base.model.exceptions.DittoRuntimeException;
|
|
28 | 36 | import org.eclipse.ditto.base.model.signals.commands.Command;
|
29 | 37 | import org.eclipse.ditto.base.model.signals.commands.CommandResponse;
|
30 | 38 | import org.eclipse.ditto.edge.service.EdgeServiceTimeoutException;
|
31 |
| -import org.eclipse.ditto.internal.utils.pekko.PekkoClassLoader; |
32 |
| -import org.eclipse.ditto.internal.utils.pekko.logging.DittoLoggerFactory; |
33 |
| -import org.eclipse.ditto.internal.utils.pekko.logging.ThreadSafeDittoLogger; |
34 | 39 | import org.eclipse.ditto.internal.utils.cacheloaders.AskWithRetry;
|
35 | 40 | import org.eclipse.ditto.internal.utils.cacheloaders.config.AskWithRetryConfig;
|
36 | 41 | import org.eclipse.ditto.internal.utils.cacheloaders.config.DefaultAskWithRetryConfig;
|
37 | 42 | import org.eclipse.ditto.internal.utils.config.DefaultScopedConfig;
|
38 |
| - |
39 |
| -import org.apache.pekko.actor.AbstractExtensionId; |
40 |
| -import org.apache.pekko.actor.ActorRef; |
41 |
| -import org.apache.pekko.actor.ActorSystem; |
42 |
| -import org.apache.pekko.actor.ExtendedActorSystem; |
43 |
| -import org.apache.pekko.actor.Extension; |
44 |
| -import org.apache.pekko.cluster.pubsub.DistributedPubSubMessage; |
45 |
| -import org.apache.pekko.pattern.AskTimeoutException; |
| 43 | +import org.eclipse.ditto.internal.utils.pekko.PekkoClassLoader; |
| 44 | +import org.eclipse.ditto.internal.utils.pekko.logging.DittoLoggerFactory; |
| 45 | +import org.eclipse.ditto.internal.utils.pekko.logging.ThreadSafeDittoLogger; |
46 | 46 |
|
47 | 47 | /**
|
48 | 48 | * Forwards commands from the edges to a specified ActorRef, waiting for a response if the command demands one.
|
@@ -208,7 +208,13 @@ private DittoRuntimeException reportError(final Command<?> command,
|
208 | 208 | : throwable;
|
209 | 209 | final var dre = DittoRuntimeException.asDittoRuntimeException(
|
210 | 210 | error, t -> reportUnexpectedError(command, t));
|
211 |
| - LOGGER.withCorrelationId(command).info("{}: {}", dre.getClass().getSimpleName(), dre.getMessage()); |
| 211 | + if (dre.getHttpStatus().equals(HttpStatus.PRECONDITION_FAILED)) { |
| 212 | + LOGGER.withCorrelationId(command) |
| 213 | + .debug("Precondition failed: <{}: {}>", dre.getClass().getSimpleName(), dre.getMessage()); |
| 214 | + } else { |
| 215 | + LOGGER.withCorrelationId(command) |
| 216 | + .info("{}: {}", dre.getClass().getSimpleName(), dre.getMessage()); |
| 217 | + } |
212 | 218 | return dre;
|
213 | 219 | }
|
214 | 220 |
|
|
0 commit comments