mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-02 13:42:55 +00:00
Merge branch 'develop' of https://github.com/misode/dev into develop
This commit is contained in:
@@ -6,8 +6,12 @@ export const mcdata = (version: string, registry: string) => {
|
||||
|
||||
export const RegistryFetcher = async (target: CollectionRegistry, registries: string[], version = 'master') => {
|
||||
await Promise.all(registries.map(async r => {
|
||||
const res = await fetch(mcdata(version, r))
|
||||
const data = await res.json()
|
||||
target.register(r, data.values)
|
||||
try {
|
||||
const res = await fetch(mcdata(version, r))
|
||||
const data = await res.json()
|
||||
target.register(r, data.values)
|
||||
} catch (e) {
|
||||
console.error(`Error occurred while fetching registry for ${r}.`, e)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user