From a429aab25a58332e99752716fca50ac6f07c5c5b Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Thu, 28 Nov 2024 18:16:35 -0500 Subject: [PATCH] shutdowninternal should not return error --- android/src/main/java/land/fx/fula/FulaModule.java | 3 +-- ios/Fula.swift | 14 ++++++++++---- package.json | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/land/fx/fula/FulaModule.java b/android/src/main/java/land/fx/fula/FulaModule.java index 92044f2..8e02e39 100755 --- a/android/src/main/java/land/fx/fula/FulaModule.java +++ b/android/src/main/java/land/fx/fula/FulaModule.java @@ -1197,8 +1197,7 @@ private void shutdownInternal() throws Exception { } } catch (Exception e) { - Log.d("ReactNative", "shutdownInternal"+ e.getMessage()); - throw (e); + Log.d("ReactNative", "shutdownInternal error: "+ e.getMessage()); } } diff --git a/ios/Fula.swift b/ios/Fula.swift index 34db920..d481bd0 100644 --- a/ios/Fula.swift +++ b/ios/Fula.swift @@ -1220,12 +1220,18 @@ class FulaModule: NSObject { } - func shutdownInternal() throws { + func shutdownInternal() { NSLog("ReactNative shutdownInternal") - if(self.fula != nil) { + if self.fula != nil { NSLog("ReactNative shutdownInternal fula is not null") - try self.fula?.shutdown() - NSLog("ReactNative shutdownInternal fula.shutdown called") + do { + try self.fula?.shutdown() + NSLog("ReactNative shutdownInternal fula.shutdown called") + } catch { + // Handle specific errors if needed or log them + NSLog("ReactNative shutdownInternal error: \(error.localizedDescription)") + } + // Ensure resources are cleaned up regardless of errors self.fula = nil self.client = nil self.wnfs = nil diff --git a/package.json b/package.json index a0591b1..6af7efe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@functionland/react-native-fula", - "version": "1.54.29", + "version": "1.54.30", "description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs", "main": "lib/commonjs/index", "module": "lib/module/index",