Skip to content

Commit

Permalink
fix: handle bad request in feed index lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Sep 16, 2024
1 parent 7440569 commit 0036384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/feed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -60,7 +61,7 @@ export async function findNextIndex(

return makeHexString(feedUpdate.feedIndexNext, FEED_INDEX_HEX_LENGTH)
} catch (e: any) {

Check warning on line 63 in src/feed/index.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type
if (e?.response?.status === 404) {
if (e instanceof BeeResponseError) {
return bytesToHex(makeBytes(8))
}
throw e
Expand Down

0 comments on commit 0036384

Please sign in to comment.