add error logging to iconstore

This commit is contained in:
Jacob Overgaard
2023-01-23 16:36:54 +01:00
parent e87439ff5f
commit a6ab87d12c

View File

@@ -33,9 +33,15 @@ export class UmbIconStore extends UUIIconRegistry {
const icon = this.provideIcon(iconName);
import(/* @vite-ignore */ `${this.#baseValue}${iconManifest.path}`).then((iconModule) => {
icon.svg = iconModule.default;
});
const iconPath = `${this.#baseValue}${iconManifest.path}`;
import(/* @vite-ignore */ iconPath)
.then((iconModule) => {
icon.svg = iconModule.default;
})
.catch((err) => {
console.error(`Failed to load icon ${iconName} on path ${iconPath}`, err.message);
});
return true;
}