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

Is there a way to catch 404 error ? #447

Open
impestdev opened this issue May 5, 2022 · 1 comment
Open

Is there a way to catch 404 error ? #447

impestdev opened this issue May 5, 2022 · 1 comment

Comments

@impestdev
Copy link

No description provided.

@mikejdegroot
Copy link

FYI for anyone else looking I got this working with this:

  const fetchFont = async (fontName: string) => {
    try {
      const promise = new Promise((resolve, reject) => {
        WebFont.load({
          google: { families: [fontName] },
          active: () => resolve("true"),
          inactive: () => reject("404"),
        })
      })
      await promise
      .....
    } catch (err) {
      console.log("HAS ERR", err)
      .....
    }
  }

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