From a207694e516de8d839d58714dbbc05d4a1234817 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 5 Dec 2023 15:33:38 +0100 Subject: [PATCH] Added logging for not existing resource url. --- cli/src/main/java/de/jplag/cli/server/ResponseData.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/src/main/java/de/jplag/cli/server/ResponseData.java b/cli/src/main/java/de/jplag/cli/server/ResponseData.java index 297faf3a7..94c527abb 100644 --- a/cli/src/main/java/de/jplag/cli/server/ResponseData.java +++ b/cli/src/main/java/de/jplag/cli/server/ResponseData.java @@ -2,6 +2,9 @@ import java.io.InputStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Data for a http response * @param stream The stream containing the binary data @@ -9,6 +12,9 @@ * @param size The total size of the data */ public record ResponseData(InputStream stream, ContentType contentType, int size) { + + private static final Logger logger = LoggerFactory.getLogger(ResponseData.class); + /** * Constructor with unknown type and size. Type will be set to PLAIN. * @param data The binary data to respond with @@ -41,6 +47,9 @@ public static ResponseData fromResourceUrl(String url) { if (inputStream != null) { return new ResponseData(inputStream, ContentType.fromPath(url)); } else { + logger.info( + "No response data available for resource url {}. This is probably normal behaviour and the data will be pulled from a different source.", + url); return null; } }