Add error handling for dynamic import in loadCustomGlyphDefinitions
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
This commit is contained in:
co-authored by
Tyriar
parent
7a7abddc45
commit
c2890d8a4d
@@ -28,6 +28,10 @@ export function loadCustomGlyphDefinitions(): Promise<void> {
|
|||||||
if (!loadingPromise) {
|
if (!loadingPromise) {
|
||||||
loadingPromise = import('./CustomGlyphDefinitions').then(module => {
|
loadingPromise = import('./CustomGlyphDefinitions').then(module => {
|
||||||
customGlyphDefinitions = module.customGlyphDefinitions;
|
customGlyphDefinitions = module.customGlyphDefinitions;
|
||||||
|
}).catch(err => {
|
||||||
|
// Reset the loading promise on failure to allow retry
|
||||||
|
loadingPromise = undefined;
|
||||||
|
throw err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return loadingPromise;
|
return loadingPromise;
|
||||||
|
|||||||
Reference in New Issue
Block a user