bramstein/fontfaceobserver

Uncaught exception on incorrect font name

SamStonehouse opened this issue · 3 comments

I've been getting some exceptions which I believe are down to me incorrectly naming a font:

Uncaught (in promise) A {family: "Source Sans Pro Regular", style: "normal", weight: "normal", stretch: "normal"}

Would it be possible to have nicer error reporting than this?

What kind of error message would you like to see in this case? I haven't been very satisfied with the rejection messages, so any input is welcome.

I don't have a preference, just not an uncaught exception. An indication that it could be the font name would be useful, I'm not sure what else could cause it to fail.

There are a couple of other cases that cause the font to fail loading (network, timeout, etc.), but it's hard to distinguish between them from JavaScript. I'll have a look and see if I can make it better.