2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-19 16:59:02 +00:00

chore: log errors in loader in utils

This commit is contained in:
Vjacheslav Trushkin 2023-08-17 09:23:29 +03:00
parent ce9c10c9f5
commit 957a9eda66
2 changed files with 10 additions and 2 deletions

View File

@ -29,7 +29,11 @@ export async function getCustomIcon(
const inline = custom[icon]; const inline = custom[icon];
result = typeof inline === 'function' ? await inline() : inline; result = typeof inline === 'function' ? await inline() : inline;
} }
} catch { } catch (err) {
console.warn(
`Failed to load custom icon "${icon}" in "${collection}":`,
err
);
return; return;
} }

View File

@ -15,7 +15,11 @@ export const loadIcon: UniversalIconLoader = async (
let result: string | IconifyJSON | undefined; let result: string | IconifyJSON | undefined;
try { try {
result = await custom(icon); result = await custom(icon);
} catch { } catch (err) {
console.warn(
`Failed to load custom icon "${icon}" in "${collection}":`,
err
);
return; return;
} }