diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-01-15 15:27:06 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-01-15 15:27:06 +0100 |
commit | 623c5906f15ffb07048f7326809c7de4dc0c8d8f (patch) | |
tree | 2212d039f6e6c2f2652c1b62583f8f78c860ab73 /jdisc_http_service/src/main/java/com/yahoo | |
parent | b81f58097056713fc060b13acabbe8fb0250fbd7 (diff) |
Remove checked IOException from toJson()
Diffstat (limited to 'jdisc_http_service/src/main/java/com/yahoo')
-rw-r--r-- | jdisc_http_service/src/main/java/com/yahoo/container/logging/ConnectionLogEntry.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/jdisc_http_service/src/main/java/com/yahoo/container/logging/ConnectionLogEntry.java b/jdisc_http_service/src/main/java/com/yahoo/container/logging/ConnectionLogEntry.java index 6702e7a5fcc..bd69de10434 100644 --- a/jdisc_http_service/src/main/java/com/yahoo/container/logging/ConnectionLogEntry.java +++ b/jdisc_http_service/src/main/java/com/yahoo/container/logging/ConnectionLogEntry.java @@ -5,8 +5,8 @@ package com.yahoo.container.logging; import com.yahoo.slime.Cursor; import com.yahoo.slime.Slime; import com.yahoo.slime.SlimeUtils; +import com.yahoo.yolean.Exceptions; -import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.UUID; @@ -54,7 +54,7 @@ public class ConnectionLogEntry { this.sslSniServerName = builder.sslSniServerName; } - public String toJson() throws IOException { + public String toJson() { Slime slime = new Slime(); Cursor cursor = slime.setObject(); cursor.setString("id", id.toString()); @@ -78,7 +78,7 @@ public class ConnectionLogEntry { setTimestamp(sslCursor, "peerNotAfter", sslPeerNotAfter); setString(sslCursor, "sniServerName", sslSniServerName); } - return new String(SlimeUtils.toJsonBytes(slime), StandardCharsets.UTF_8); + return new String(Exceptions.uncheck(() -> SlimeUtils.toJsonBytes(slime)), StandardCharsets.UTF_8); } private void setString(Cursor cursor, String key, String value) { |