Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,22 @@ async function testRetrieval({
}) {
const url = `https://${clientAddress}.${CDN_HOSTNAME}/${pieceCid}`
console.log('Fetching', url)
const res = await fetch(url)

let res
try {
res = await fetch(url)
} catch (err) {
console.error(
'ALERT Cannot retrieve data set %s piece %sfrom %s via %s: %s',
String(dataSetId),
String(pieceId),
botLocation ?? '<dev>',
url,
err,
)
return
}

console.log('-> Status code:', res.status)
if (!res.ok) {
const reason = (await res.text()).trim()
Expand Down