From 0036384ab1da2dd61aabcbdf0b34f293b069ce3e Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Mon, 16 Sep 2024 19:14:26 +0200 Subject: [PATCH] fix: handle bad request in feed index lookup --- src/feed/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/feed/index.ts b/src/feed/index.ts index f296b8ab..8f64b9dc 100644 --- a/src/feed/index.ts +++ b/src/feed/index.ts @@ -18,6 +18,7 @@ import { UploadResult, } from '../types' import { Bytes, bytesAtOffset, makeBytes } from '../utils/bytes' +import { BeeResponseError } from '../utils/error' import { EthAddress, HexEthAddress, makeHexEthAddress } from '../utils/eth' import { keccak256Hash } from '../utils/hash' import { HexString, bytesToHex, hexToBytes, makeHexString } from '../utils/hex' @@ -60,7 +61,7 @@ export async function findNextIndex( return makeHexString(feedUpdate.feedIndexNext, FEED_INDEX_HEX_LENGTH) } catch (e: any) { - if (e?.response?.status === 404) { + if (e instanceof BeeResponseError) { return bytesToHex(makeBytes(8)) } throw e