ruby on rails - Possible to ignore a line of code and reload page on a crash? -


i have soundcloud urls embeded using gem called auto_html. every , site randomly crashes error thats seems timed out request traffic on soundcloud? there way ignore lines of code embeds files when request timed out , reload page?

error:

json::parsererror  actionview::template::error (757: unexpected token @ '<!doctype html public  "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd">            unable process request in time - soundcloud           yikes, unable process request in time.           please reload page or try again in moment. 

code ignored in view:

41:        <% if micropost.url.include? 'soundcloud' %> 42:          <%= auto_html(micropost.url) {soundcloud}  %> 43:        <% end %>  

i guess can create helper method "execute" auto_html helper method , return result. in method can surround call begin, rescue , on error can return js reload (window.location.href...).

i don't know if can redirect through helper method, if yes easier.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -