From 84618bb74966a83a0fb7f2a4f36125c03d465f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Helge=20=C3=98verland?= Date: Fri, 18 Oct 2024 15:01:48 +0200 Subject: [PATCH] fix: Update code --- .../hibernate/jsonb/type/JsonAttributeValueBinaryType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/jsonb/type/JsonAttributeValueBinaryType.java b/dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/jsonb/type/JsonAttributeValueBinaryType.java index 25031fbe0043..2df4fdc0eceb 100644 --- a/dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/jsonb/type/JsonAttributeValueBinaryType.java +++ b/dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/jsonb/type/JsonAttributeValueBinaryType.java @@ -30,6 +30,7 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; +import java.io.UncheckedIOException; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -69,7 +70,7 @@ public String convertObjectToJson(Object object) { return writer.writeValueAsString(attrValueMap); } catch (IOException ex) { - throw new RuntimeException("Failed to serialize JSON", ex); + throw new UncheckedIOException("Failed to serialize JSON", ex); } } @@ -86,7 +87,7 @@ public Object convertJsonToObject(String content) { return convertAttributeValueMapIntoSet(data); } catch (IOException ex) { - throw new RuntimeException("Failed to deserialize JSON", ex); + throw new UncheckedIOException("Failed to deserialize JSON", ex); } }