Dont try to fetch 4bytes again in case of network errors

This commit is contained in:
Willian Mitsuda 2022-08-23 18:11:32 -03:00
parent d09fe7a023
commit 682549fa4c
No known key found for this signature in database

View File

@ -53,6 +53,7 @@ const fourBytesFetcher =
const fourBytes = key.slice(2);
const signatureURL = fourBytesURL(assetsURLPrefix, fourBytes);
try {
const res = await fetch(signatureURL);
if (!res.ok) {
console.warn(`Signature does not exist in 4bytes DB: ${fourBytes}`);
@ -70,6 +71,11 @@ const fourBytesFetcher =
signature: sig,
};
return entry;
} catch (err) {
// Network error or something wrong with URL config;
// silence and don't try it again
return null;
}
};
/**