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

Handle bad OEmbed responses and return message #110

Merged

Conversation

nicolas-fricke
Copy link
Contributor

When requesting an OEmbed object, handle the situation that the provider might return a non-successful response. In that case, render a message for the user explaining that there was an error with the embedded element.

For this, standardize the OEbedResolver::Base#source_url method and add a #name method which will be included in the text for the user.

The text for the user will be rendered within the <figure> element within a nested span with the class unavailable-embed. This also allows the consumer to have custom CSS for this case.

When requesting an OEmbed object, handle the situation that the provider
might return a non-successful response. In that case, have `oembed_data`
return `nil` and keep the `figure div.embed` element empty.
When a requested OEmbed object returns an error, render a message for
the user explaining that there was an error with the embedded element.

For this, standardize the `OEbedResolver::Base#source_url` method and
add a `#name` method which will be included in the text for the user.

The text for the user will be rendered within the `<figure>` element
within a nested `span` with the class `unavailable-embed`. This also
allows the consumer to have custom CSS for this case.
@christofdamian
Copy link
Contributor

+1

@nicolas-fricke nicolas-fricke merged commit 1d6d7fe into Devex:master Nov 7, 2017
@nicolas-fricke nicolas-fricke deleted the handle-oembed-bad-responses branch November 8, 2017 08:07
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

Successfully merging this pull request may close these issues.

None yet

4 participants