diff --git a/src/lib/core/streamr/index.ts b/src/lib/core/streamr/index.ts index 06bb2cf..8c5ee35 100644 --- a/src/lib/core/streamr/index.ts +++ b/src/lib/core/streamr/index.ts @@ -66,9 +66,14 @@ export default class implements Hooks { await new Promise((resolve) => setTimeout(resolve, 2000)); } catch (error) { console.error(`[streamr] Error publishing to Streamr:`, error); + throw error; } finally { // destroy the client to free resources - await streamrClient.destroy(); + try { + await streamrClient.destroy(); + } catch (destroyError) { + console.error(`[streamr] Error destroying client:`, destroyError); + } } } } diff --git a/src/lib/core/streamr/ui.ts b/src/lib/core/streamr/ui.ts index b320ae0..91efc6d 100644 --- a/src/lib/core/streamr/ui.ts +++ b/src/lib/core/streamr/ui.ts @@ -147,8 +147,13 @@ export default class implements UIHooks { console.log(`[streamr-ui] Published ${pendingTransactions.length} transactions to stream ${streamId}`); } catch (error) { console.error(`[streamr-ui] Error publishing to Streamr:`, error); + throw error; } finally { - await streamrClient.destroy(); + try { + await streamrClient.destroy(); + } catch (destroyError) { + console.error(`[streamr-ui] Error destroying client:`, destroyError); + } } } }