<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shwango! blog &#187; ruby</title>
	<atom:link href="http://blog.shwango.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shwango.com</link>
	<description>life, love and some other stuff...</description>
	<lastBuildDate>Sun, 14 Jun 2009 15:51:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby Timeout::Error</title>
		<link>http://blog.shwango.com/2008/03/06/ruby-timeouterror/</link>
		<comments>http://blog.shwango.com/2008/03/06/ruby-timeouterror/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 17:45:04 +0000</pubDate>
		<dc:creator>osterday</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.shwango.com/2008/03/06/ruby-timeouterror/</guid>
		<description><![CDATA[I wanted to post this before, but got busy and now I can&#8217;t find the original post about this, but anyway&#8230;
When doing network stuff in Ruby &#8211; using any Net:: libs &#8211; there&#8217;s a little trick to trap for timeouts.  You can&#8217;t simply use &#8220;rescue&#8221; do handle it.  The timeout error is not [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to post this before, but got busy and now I can&#8217;t find the original post about this, but anyway&#8230;</p>
<p>When doing network stuff in Ruby &#8211; using any Net:: libs &#8211; there&#8217;s a little trick to trap for timeouts.  You can&#8217;t simply use &#8220;rescue&#8221; do handle it.  The timeout error is not a subclass of the standard error, so you have to explicitly trap for it:</p>
<p>begin<br />
# Do network stuff<br />
rescue Timeout::Error<br />
# Timeout error<br />
rescue<br />
# Other error<br />
end</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shwango.com/2008/03/06/ruby-timeouterror/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

