Fix handling of broken items on startup

This commit is contained in:
Fedor Indutny 2023-08-18 20:02:00 +02:00 committed by Jamie Kyle
parent d0cac2263e
commit 6f14b5f45d

View file

@ -426,11 +426,15 @@ async function getAllItems(): Promise<AllItemsType> {
const keys = ITEM_SPECS[key];
const deserializedValue = keys
? (specToBytes(keys, { value }) as ItemType<typeof key>).value
: value;
try {
const deserializedValue = keys
? (specToBytes(keys, { value }) as ItemType<typeof key>).value
: value;
result[key] = deserializedValue;
result[key] = deserializedValue;
} catch (error) {
log.warn(`getAllItems(${id}): Failed to parse item from spec`, error);
}
}
return result;