<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: Ruby Exceptions And Exception Handling</title> <atom:link href="http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/feed/" rel="self" type="application/rss+xml" /><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/</link> <description>For the betterment of the software craft...</description> <lastBuildDate>Mon, 21 Nov 2011 13:57:06 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.2</generator> <item><title>By: Getting to know ruby exceptions &#171; Ruby Noobie</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3401</link> <dc:creator>Getting to know ruby exceptions &#171; Ruby Noobie</dc:creator> <pubDate>Mon, 18 Jan 2010 23:34:57 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3401</guid> <description>[...] references: Programming Ruby &#8211; Skorks post on exceptions &#8211; Google Possibly related posts: (automatically generated)Dealing with Java exceptions in [...]</description> <content:encoded><![CDATA[<p>[...] references: Programming Ruby &#8211; Skorks post on exceptions &#8211; Google Possibly related posts: (automatically generated)Dealing with Java exceptions in [...]</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3085</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Mon, 28 Sep 2009 13:47:11 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3085</guid> <description>No at all, I appreciate the prod :), I should have updated it straight away, but over the weekend time got away from me. Thanks for the reminder, I will update the post shortly (most likely sometime tomorrow).</description> <content:encoded><![CDATA[<p>No at all, I appreciate the prod :), I should have updated it straight away, but over the weekend time got away from me. Thanks for the reminder, I will update the post shortly (most likely sometime tomorrow).</p> ]]></content:encoded> </item> <item><title>By: raggi</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3084</link> <dc:creator>raggi</dc:creator> <pubDate>Mon, 28 Sep 2009 13:43:27 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3084</guid> <description>Sorry for re-raising the same point on Exception catches, I guess it&#039;s time you correct the article?</description> <content:encoded><![CDATA[<p>Sorry for re-raising the same point on Exception catches, I guess it&#8217;s time you correct the article?</p> ]]></content:encoded> </item> <item><title>By: raggi</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3083</link> <dc:creator>raggi</dc:creator> <pubDate>Mon, 28 Sep 2009 13:42:27 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3083</guid> <description>You shouldn&#039;t really use Exception as the base class for custom exceptions. rescue without arguments only rescues from StandardError.
When creating your own exceptions, I strongly recommend storing the data that caused the exception on the exception object itself. This greatly aids in debugging, especially in a well tested environment.
Example:
class MyError &lt; StandardError
attr_accessor :some_object, :some_operation
def initialize(object, operation)
@some_object, @some_operation = object, operation
super(&quot;Failed to perform #{operation} on #{object}&quot;)
end
end
You can even use these error classes as domain events, and avoid raising them in a raise free architecture.</description> <content:encoded><![CDATA[<p>You shouldn&#8217;t really use Exception as the base class for custom exceptions. rescue without arguments only rescues from StandardError.</p><p>When creating your own exceptions, I strongly recommend storing the data that caused the exception on the exception object itself. This greatly aids in debugging, especially in a well tested environment.</p><p>Example:</p><p>class MyError &lt; StandardError<br
/> attr_accessor :some_object, :some_operation<br
/> def initialize(object, operation)<br
/> @some_object, @some_operation = object, operation<br
/> super(&quot;Failed to perform #{operation} on #{object}&quot;)<br
/> end<br
/> end</p><p>You can even use these error classes as domain events, and avoid raising them in a raise free architecture.</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3060</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Fri, 25 Sep 2009 14:43:46 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3060</guid> <description>Thanks man, yeah I saw the comment and replied. It doesn&#039;t really bother me, people are entitled to their own opinion, if they don&#039;t like what I write they&#039;ll just go and read something else which is perfectly alright.
I write what I am learning and what I am thinking about as well as about anything else I find interesting. Some of it you can find in books and online (possibly because I read books as well as the web :)), other stuff is my own opinions and ideas. I post it all to various places so that other people have a chance to read it too, but only if they want to :).
I&#039;ll keep blogging about ruby basics, and once I run out of basics, about more advanced stuff, after that we&#039;ll see, because right now that is what I am finding interesting.</description> <content:encoded><![CDATA[<p>Thanks man, yeah I saw the comment and replied. It doesn&#8217;t really bother me, people are entitled to their own opinion, if they don&#8217;t like what I write they&#8217;ll just go and read something else which is perfectly alright.</p><p>I write what I am learning and what I am thinking about as well as about anything else I find interesting. Some of it you can find in books and online (possibly because I read books as well as the web :)), other stuff is my own opinions and ideas. I post it all to various places so that other people have a chance to read it too, but only if they want to :).</p><p>I&#8217;ll keep blogging about ruby basics, and once I run out of basics, about more advanced stuff, after that we&#8217;ll see, because right now that is what I am finding interesting.</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3059</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Fri, 25 Sep 2009 14:36:40 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3059</guid> <description>A couple of people have mentioned this one, thanks for the info, I appreciate it.</description> <content:encoded><![CDATA[<p>A couple of people have mentioned this one, thanks for the info, I appreciate it.</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3058</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Fri, 25 Sep 2009 14:35:44 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3058</guid> <description>So you&#039;re saying that signals are treated as exceptions? So rescuing Exception can allow you to catch ctrl-C, that&#039;s really interesting I have to play around with this :). I&#039;ve been meaning to write something about unix signals anyway, this might be a good opportunity.
Yeah, rescuing Exception is no good whatever language you&#039;re using. Although I can see how this could be particularly bad with Ruby (with Java I sometimes do this just so I can re-throw it as a RuntimeException :)).</description> <content:encoded><![CDATA[<p>So you&#8217;re saying that signals are treated as exceptions? So rescuing Exception can allow you to catch ctrl-C, that&#8217;s really interesting I have to play around with this :). I&#8217;ve been meaning to write something about unix signals anyway, this might be a good opportunity.</p><p>Yeah, rescuing Exception is no good whatever language you&#8217;re using. Although I can see how this could be particularly bad with Ruby (with Java I sometimes do this just so I can re-throw it as a RuntimeException :)).</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3057</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Fri, 25 Sep 2009 14:30:08 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3057</guid> <description>Thanks, yeah I find that one to be a nice shortcut. It&#039;s these kinds of little shortcuts that really make me dig Ruby.</description> <content:encoded><![CDATA[<p>Thanks, yeah I find that one to be a nice shortcut. It&#8217;s these kinds of little shortcuts that really make me dig Ruby.</p> ]]></content:encoded> </item> <item><title>By: Alan Skorkin</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-3056</link> <dc:creator>Alan Skorkin</dc:creator> <pubDate>Fri, 25 Sep 2009 14:29:10 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-3056</guid> <description>Cheers for all the great info, good to know about StandardError.
I didn&#039;t even know about the fact that you could use the retry keyword to run a begin block again, that is definitely handy.
This is I think the real value in blogging, when people come along and add to and expand on what you&#039;ve written, to increase your knowledge and help anyone else who reads it later.</description> <content:encoded><![CDATA[<p>Cheers for all the great info, good to know about StandardError.</p><p>I didn&#8217;t even know about the fact that you could use the retry keyword to run a begin block again, that is definitely handy.</p><p>This is I think the real value in blogging, when people come along and add to and expand on what you&#8217;ve written, to increase your knowledge and help anyone else who reads it later.</p> ]]></content:encoded> </item> <item><title>By: lostwarrior</title><link>http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/comment-page-1/#comment-2994</link> <dc:creator>lostwarrior</dc:creator> <pubDate>Fri, 25 Sep 2009 04:24:47 +0000</pubDate> <guid
isPermaLink="false">http://www.skorks.com/?p=1215#comment-2994</guid> <description>Hi  i have seen your post in rubyflow, and i saw the comments.Don&#039;t get worried about that, the materials  you are posting in your blog may be available in agile book or in ruby pdf.But it will be usefull for the Ruby on rails beginners and you too.Try to do a little bit about ruby blocks and some crispy rails application in your blog.
regards,
Gen.lostwarrior</description> <content:encoded><![CDATA[<p>Hi  i have seen your post in rubyflow, and i saw the comments.Don&#8217;t get worried about that, the materials  you are posting in your blog may be available in agile book or in ruby pdf.But it will be usefull for the Ruby on rails beginners and you too.Try to do a little bit about ruby blocks and some crispy rails application in your blog.</p><p>regards,<br
/> Gen.lostwarrior</p> ]]></content:encoded> </item> </channel> </rss>
