Skip to content

Commit e4e12df

Browse files
committed
fix(API): surface wallet connection errors in trusted peer view
getWalletConnections catches errors internally and returns { success: false, error } instead of throwing, so settle() always sees ok: true. Check value.success before treating connections as valid, and surface the inner error when the wallet call failed.
1 parent aa6a7ff commit e4e12df

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/routes/diagnostics.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const buildTrustedPeerView = (connectionsResult, chiaConfigResult) => {
191191
view.chiaConfigError = chiaConfigResult.error;
192192
}
193193

194-
if (connectionsResult?.ok) {
194+
if (connectionsResult?.ok && connectionsResult.value?.success !== false) {
195195
const connections = connectionsResult.value?.connections || [];
196196
view.connected = connections.map((c) => {
197197
const trusted = !!(
@@ -201,7 +201,9 @@ const buildTrustedPeerView = (connectionsResult, chiaConfigResult) => {
201201
return { peerHost: c.peerHost, peerPort: c.peerPort, type: c.type, trusted };
202202
});
203203
} else if (connectionsResult) {
204-
view.connectionsError = connectionsResult.error;
204+
view.connectionsError = connectionsResult.ok
205+
? connectionsResult.value?.error || 'wallet connections unavailable'
206+
: connectionsResult.error;
205207
}
206208

207209
return view;

0 commit comments

Comments
 (0)