From 4d918f83ffb633278ae22e9f62becec53f1af039 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 8 Aug 2020 20:25:44 -0700 Subject: [PATCH] Display transaction even if getBlockTime returns an error --- explorer/src/providers/transactions/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/explorer/src/providers/transactions/index.tsx b/explorer/src/providers/transactions/index.tsx index 6834824b94..89957cccf4 100644 --- a/explorer/src/providers/transactions/index.tsx +++ b/explorer/src/providers/transactions/index.tsx @@ -232,7 +232,17 @@ export async function fetchTransactionStatus( }); if (value !== null) { - let blockTime = await connection.getBlockTime(value.slot); + let blockTime = null; + try { + blockTime = await connection.getBlockTime(value.slot); + } catch (error) { + console.error( + "Failed to fetch block time for slot ", + value.slot, + ":", + error + ); + } let timestamp: Timestamp = blockTime !== null ? blockTime : "unavailable";