From d707beb85acc6645d007284d7d9cc4796e7f2763 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 30 Jun 2023 14:46:01 +0100 Subject: [PATCH] Add exception handler to pubsub --- src/main/java/me/kavin/piped/utils/PubSubHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/kavin/piped/utils/PubSubHelper.java b/src/main/java/me/kavin/piped/utils/PubSubHelper.java index 7b07a38..23976b7 100644 --- a/src/main/java/me/kavin/piped/utils/PubSubHelper.java +++ b/src/main/java/me/kavin/piped/utils/PubSubHelper.java @@ -48,6 +48,10 @@ public class PubSubHelper { .thenAccept(resp -> { if (resp.status() != 202) System.out.println("Failed to subscribe: " + resp.status() + "\n" + new String(resp.body())); + }) + .exceptionally(e -> { + ExceptionHandler.handle((Exception) e); + return null; }); } }