figlet.js
figlet.js copied to clipboard
Unable to handle errors with preloadFonts
In
me.preloadFonts = function (fonts, next) {
I am unable to handle thrown errors from invalid font names fetched....
I am stupid - I could do this but still seems like it should be handled with preload too..
try{
const standard = (await import(`https://esm.sh/figlet/importable-fonts/${options.font}.js`)).default
figlet.parseFont(options.font, standard);
}catch(err){
throw err
}
This sounds like bug, if fetch fail to get the font it should call next() with an error.
Fixed this method for version 1.9.0 so that errors can correctly be handled.