From 94f288fa073f12fbe4e8f8d1f465619327a14896 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Tue, 19 Nov 2024 19:28:53 +0530 Subject: [PATCH] Update exception logic --- .../main/java/io/ballerina/stdlib/websub/ModuleUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java index 0db23705..9fb496c1 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java @@ -76,6 +76,11 @@ private static boolean isModuleDefinedError(BError error) { public static Object getResult(CompletableFuture balFuture) { try { return balFuture.get(); + } catch (BError error) { + throw error; + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw ErrorCreator.createError(e); } catch (Throwable throwable) { throw ErrorCreator.createError(throwable); }