<?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: Trusting in Exceptions To Do What They Do</title>
	<atom:link href="http://shifteleven.com/articles/2006/12/03/trusting-in-exceptions-to-do-what-they-do/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com/articles/2006/12/03/trusting-in-exceptions-to-do-what-they-do</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<item>
		<title>By: rick</title>
		<link>http://shifteleven.com/articles/2006/12/03/trusting-in-exceptions-to-do-what-they-do/comment-page-1#comment-39</link>
		<dc:creator>rick</dc:creator>
		<pubDate>Tue, 02 Jan 2007 20:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=20#comment-39</guid>
		<description>I think using rescue_action_in_public is a good, DRY way to handle this.  I also use just rescue_action to handle common ActiveRecord::RecordInvalid exceptions by rendering either the &#039;new&#039; or &#039;edit&#039; template.</description>
		<content:encoded><![CDATA[<p>I think using rescue_action_in_public is a good, DRY way to handle this.  I also use just rescue_action to handle common ActiveRecord::RecordInvalid exceptions by rendering either the &#8216;new&#8217; or &#8216;edit&#8217; template.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://shifteleven.com/articles/2006/12/03/trusting-in-exceptions-to-do-what-they-do/comment-page-1#comment-38</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Mon, 04 Dec 2006 10:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=20#comment-38</guid>
		<description>Forgot about that way.  Thanks.

I was not familiar with @verify@ however.  That is a pretty useful method as well, but since I&#039;ve moved to using the RESTful stuff in rails 1.2RC1, That kind of stuff already happens for me, with the IDs and whathave you.  Plus, @verify@ is only a first step, it does not verify that your data exists and something like the @rescue@ or your conditional statement is still necessary.

@rescue_action_in_public@ is a neat method; however, I often reserve that method for &quot;Exception Logger&quot;:http://svn.techno-weenie.net/projects/plugins/exception_logger/</description>
		<content:encoded><![CDATA[<p>Forgot about that way.  Thanks.</p>
<p>I was not familiar with @verify@ however.  That is a pretty useful method as well, but since I&#8217;ve moved to using the RESTful stuff in rails 1.2RC1, That kind of stuff already happens for me, with the IDs and whathave you.  Plus, @verify@ is only a first step, it does not verify that your data exists and something like the @rescue@ or your conditional statement is still necessary.</p>
<p>@rescue_action_in_public@ is a neat method; however, I often reserve that method for &#8220;Exception Logger&#8221;:http://svn.techno-weenie.net/projects/plugins/exception_logger/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxim Kulkin</title>
		<link>http://shifteleven.com/articles/2006/12/03/trusting-in-exceptions-to-do-what-they-do/comment-page-1#comment-37</link>
		<dc:creator>Maxim Kulkin</dc:creator>
		<pubDate>Sun, 03 Dec 2006 23:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=20#comment-37</guid>
		<description>&lt;p&gt;
There is also another solution:
&lt;pre&gt;
  def show
    @article = Article.find_by_id(params[:id])
    unless @article
      flash[:error] = &#039;That article does not exist&#039;
      redirect_to :action =&gt; &#039;index&#039;
    end
  end
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
And don&#039;t forget about &lt;i&gt;verify&lt;/i&gt; method that could be used to make sure that user passed non-empty id param to that action.
&lt;/p&gt;
&lt;p&gt;
Although I would prefer ot put such rescue clauses in separate place (e.g. &lt;i&gt;rescue_action_in_public&lt;/i&gt;).
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>
There is also another solution:</p>
<pre>
  def show
    @article = Article.find_by_id(params[:id])
    unless @article
      flash[:error] = 'That article does not exist'
      redirect_to :action => 'index'
    end
  end
</pre>
</p>
<p>
And don&#8217;t forget about <i>verify</i> method that could be used to make sure that user passed non-empty id param to that action.
</p>
<p>
Although I would prefer ot put such rescue clauses in separate place (e.g. <i>rescue_action_in_public</i>).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
