From 6fe929883f9de097dbe1dc6dd43c5e2018c5e0ac Mon Sep 17 00:00:00 2001 From: Matthew Ramsden <6657488+reez@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:15:11 -0500 Subject: [PATCH] chore: handle remaining error states --- .../Service/Lightning Service/LightningNodeService.swift | 7 +------ LDKNodeMonday/View/Home/Send/AmountView.swift | 2 +- LDKNodeMonday/View/Profile/Channel/ChannelAddView.swift | 7 ++++++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift b/LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift index d3094fa..c162cdb 100644 --- a/LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift +++ b/LDKNodeMonday/Service/Lightning Service/LightningNodeService.swift @@ -81,12 +81,7 @@ class LightningNodeService { } nodeBuilder.setEntropyBip39Mnemonic(mnemonic: mnemonic, passphrase: nil) - // TODO: -! - /// 06.22.23 - /// Breaking change in ldk-node 0.1 today - /// `build` now `throws` - /// - Resolve by actually handling error - let ldkNode = try! nodeBuilder.build() + let ldkNode = try! nodeBuilder.build() // Handle error instead of "!" self.ldkNode = ldkNode } diff --git a/LDKNodeMonday/View/Home/Send/AmountView.swift b/LDKNodeMonday/View/Home/Send/AmountView.swift index 2b2abfc..6d51c34 100644 --- a/LDKNodeMonday/View/Home/Send/AmountView.swift +++ b/LDKNodeMonday/View/Home/Send/AmountView.swift @@ -151,7 +151,7 @@ struct AmountView: View { } else { viewModel.amountConfirmationViewError = .init( title: "Unexpected error", - detail: "Not sure" // TODO: do better + detail: "Unknown error occured" ) } case .isLightningURL: diff --git a/LDKNodeMonday/View/Profile/Channel/ChannelAddView.swift b/LDKNodeMonday/View/Profile/Channel/ChannelAddView.swift index 9d05cd9..7d1dd3a 100644 --- a/LDKNodeMonday/View/Profile/Channel/ChannelAddView.swift +++ b/LDKNodeMonday/View/Profile/Channel/ChannelAddView.swift @@ -40,7 +40,12 @@ struct ChannelAddView: View { ) } } else { - // TODO: Handle + DispatchQueue.main.async { + viewModel.channelAddViewError = .init( + title: "Unexpected error", + detail: "Failed to retrieve string from pasteboard." + ) + } } } else { DispatchQueue.main.async {