0
我使用稱爲auto_html的gem嵌入了soundcloud網址。偶爾我的網站會隨機崩潰,這個錯誤似乎是來自Soundcloud上過多流量的超時請求?有什麼辦法可以忽略當代碼超時並重新加載頁面時嵌入文件的代碼行嗎?可能會忽略一行代碼並在崩潰時重新加載頁面?
錯誤:
JSON::ParserError
ActionView::Template::Error (757: unexpected token at '<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
We were unable to process your request in time - SoundCloud
Yikes, we were unable to process your request in time.
Please reload the page or try again in a moment.
代碼在視圖中被忽略:
41: <% if micropost.url.include? 'soundcloud' %>
42: <%= auto_html(micropost.url) {soundcloud} %>
43: <% end %>
我可以只使用rails redirect_to方法,我想?如果你有時間,我可以給你一個如何在失敗時使用救援的例子 – Jaqx 2013-05-03 02:41:39