From cca4e742c055ff4da7e0f20886b5a30399e726f6 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Mon, 27 May 2024 12:14:53 +0200 Subject: [PATCH] websocket check for error message --- src/websockets.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/websockets.ts b/src/websockets.ts index 6cc35c5..04d47ef 100644 --- a/src/websockets.ts +++ b/src/websockets.ts @@ -31,7 +31,11 @@ class WebSocketClient { // By parsing the message, we can link it with existing cached message and return the updated version of the message let res: CachedMessage = await services.parseNetworkMessage(msgData, feeRate); console.debug(res); - if (res.status === 'FaucetComplete') { + if (res.status === 'Error') { + if (res.error) { + console.error(res.error); + } + } else if (res.status === 'FaucetComplete') { // we received a faucet tx, there's nothing else to do window.alert(`New faucet output\n${res.commited_in}`); await services.updateMessages(res);