From 28d7ff18ba3e9ed59800eca3aedba0eb348eb4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 20 Dec 2022 15:13:21 +0100 Subject: [PATCH] Throw exception in case of serialization issue --- .../java/wtf/beatrice/hidekobot/util/SerializationUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/util/SerializationUtil.java b/src/main/java/wtf/beatrice/hidekobot/util/SerializationUtil.java index 1fd71bb..5be4092 100644 --- a/src/main/java/wtf/beatrice/hidekobot/util/SerializationUtil.java +++ b/src/main/java/wtf/beatrice/hidekobot/util/SerializationUtil.java @@ -18,8 +18,9 @@ public class SerializationUtil so.flush(); return Base64.getEncoder().encodeToString(bo.toByteArray()); } - catch (IOException ignored) {} - return null; + catch (IOException e) { + throw new SerializationException("Error during serialization", e); + } } public static LinkedList deserializeBase64(String dataStr) {