From: <nul...@cl...> - 2012-01-06 07:34:28
|
TADA Tadashi 2012-01-06 16:33:55 +0900 (Fri, 06 Jan 2012) New Revision: fad65b4e45c3683081f996f3135ebcf2f18cc519 Log: show an error message when API timeouted. Modified files: ChangeLog misc/plugin/amazon.rb Modified: ChangeLog (+3 -0) =================================================================== --- ChangeLog 2012-01-05 17:30:39 +0900 (cf23a6b) +++ ChangeLog 2012-01-06 16:33:55 +0900 (2bed8c0) @@ -1,3 +1,6 @@ +2012-01-06 TADA Tadashi <t...@td...> + * plugin/amazon.rb: show an error message when API timeouted. + 2012-01-05 TADA Tadashi <t...@td...> * filter/antispamservice.rb: discontinued using Net::HTTP.version_1_1. Modified: misc/plugin/amazon.rb (+6 -1) =================================================================== --- misc/plugin/amazon.rb 2012-01-05 17:30:39 +0900 (47e2519) +++ misc/plugin/amazon.rb 2012-01-06 16:33:55 +0900 (9cdba32) @@ -273,7 +273,12 @@ def amazon_get( asin, with_image = true, label = nil, pos = 'amazon' ) amazon_to_html( item, with_image, label, pos ) end rescue Timeout::Error - asin + @logger.error "amazon.rb: Amazon API Timeouted." + message = asin + if @mode == 'preview' then + message << %Q|<span class="message">(Amazon API Timeouted))</span>| + end + message rescue NoMethodError message = label || asin if @mode == 'preview' then |