microlinkhq / sdk

Make any URL embeddable. Turn any URL into a beautiful link preview.

Home Page:https://microlink.io/sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an error UI state

breadadams opened this issue · comments

Feature Request

Is your feature request related to a problem? Please describe.

If the request fails the card shows up empty:

image

Describe the solution you'd like
We should show some warning text telling the user it has failed, with an option to retry the request.

Likewise, I'm curious if there's a way to check for a failed request?

It's on the roadmap @roz0n - all PRs are welcome though! 😄

While I haven't looked at the source code... I think it might be possible to pass a function to the component that returns the request object that's currently throwing an error outside a catch block.

I'll give this a shot!

A first approximation will be shipped in v5 🎉