Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to handle errors with preloadFonts #126

Open
MarketingPip opened this issue Oct 1, 2024 · 2 comments
Open

Unable to handle errors with preloadFonts #126

MarketingPip opened this issue Oct 1, 2024 · 2 comments

Comments

@MarketingPip
Copy link

In

  me.preloadFonts = function (fonts, next) {

I am unable to handle thrown errors from invalid font names fetched....

@MarketingPip
Copy link
Author

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
        }

@jcubic
Copy link
Contributor

jcubic commented Oct 8, 2024

This sounds like bug, if fetch fail to get the font it should call next() with an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants