Prevent errors in log when there is a connection timeout (#2654)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2021-12-30 10:10:38 +01:00 committed by GitHub
parent e61db5a11a
commit 646640094a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,6 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.ext.MessageBodyWriter;
import org.eclipse.jetty.io.EofException;
import org.openhab.core.io.rest.JSONInputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -90,7 +89,7 @@ public class GsonMessageBodyWriter<T> implements MessageBodyWriter<T> {
// Keep this code as it has been present before,
// but I don't think this needs to be done in the message body writer itself.
entityStream.flush();
} catch (EofException e) {
} catch (IOException e) {
// we catch this exception to avoid confusion errors in the log file, since this is not any error situation
// see https://github.com/openhab/openhab-distro/issues/1188
logger.debug("Failed writing HTTP response, since other side closed the connection");