<?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: Skipping the error handling?</title>
	<atom:link href="http://rc3.org/2008/05/13/skipping-the-error-handling/feed/" rel="self" type="application/rss+xml" />
	<link>http://rc3.org/2008/05/13/skipping-the-error-handling/</link>
	<description>Strong opinions weakly held</description>
	<lastBuildDate>Mon, 15 Mar 2010 23:37:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacob Davies</title>
		<link>http://rc3.org/2008/05/13/skipping-the-error-handling/comment-page-1/#comment-2664</link>
		<dc:creator>Jacob Davies</dc:creator>
		<pubDate>Tue, 13 May 2008 19:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8233#comment-2664</guid>
		<description>&lt;p&gt;The alternative is to have framework error handling take the &lt;em&gt;actual&lt;/em&gt; errors produced by library code and know how to interpret and display them.  That&#039;s the approach we have.  Do it once and do the deepest job of validation you can do. If synchronous UI validation is required, drive it from metadata that the library makes available, rather than separate config files.&lt;/p&gt;

&lt;p&gt;Exceptions do not in themselves work well for this approach, because they imply a single failure.  With web operations that are frequently &quot;batched&quot; in the sense that validation does not or cannot happen except for when an entire form is submitted, you may have many errors.  So you need a framework for collecting errors and supplying them to the UI in a list rather than a single failure.  We have an exception that collects other exceptions and have our library calls declared to throw that; then the specific exceptions are documented too so they can be used in front-end code.  The messages are given in a field-keyed, I18N-friendly format - (fieldId, &quot;file.not.found&quot;, filename, directory) - rather than plain precomposed strings.&lt;/p&gt;

&lt;p&gt;The expectation should be that things you call may throw either a single exception, or a collection of exceptions.  If you don&#039;t know how to handle them, you let them flow past you (our exceptions are almost all unchecked). If you have more to add yourself, you make a new collection and add the previous stuff and your stuff to it. If you made a library call, expect that exceptional conditions may produce a list of failures and be ready to handle them.&lt;/p&gt;

&lt;p&gt;The languages and libraries ought to be smart enough to encourage this kind of pattern of use.  They&#039;re not, and there doesn&#039;t seem much of a standard for it, unfortunately.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The alternative is to have framework error handling take the <em>actual</em> errors produced by library code and know how to interpret and display them.  That&#8217;s the approach we have.  Do it once and do the deepest job of validation you can do. If synchronous UI validation is required, drive it from metadata that the library makes available, rather than separate config files.</p>

<p>Exceptions do not in themselves work well for this approach, because they imply a single failure.  With web operations that are frequently &#8220;batched&#8221; in the sense that validation does not or cannot happen except for when an entire form is submitted, you may have many errors.  So you need a framework for collecting errors and supplying them to the UI in a list rather than a single failure.  We have an exception that collects other exceptions and have our library calls declared to throw that; then the specific exceptions are documented too so they can be used in front-end code.  The messages are given in a field-keyed, I18N-friendly format &#8211; (fieldId, &#8220;file.not.found&#8221;, filename, directory) &#8211; rather than plain precomposed strings.</p>

<p>The expectation should be that things you call may throw either a single exception, or a collection of exceptions.  If you don&#8217;t know how to handle them, you let them flow past you (our exceptions are almost all unchecked). If you have more to add yourself, you make a new collection and add the previous stuff and your stuff to it. If you made a library call, expect that exceptional conditions may produce a list of failures and be ready to handle them.</p>

<p>The languages and libraries ought to be smart enough to encourage this kind of pattern of use.  They&#8217;re not, and there doesn&#8217;t seem much of a standard for it, unfortunately.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafe</title>
		<link>http://rc3.org/2008/05/13/skipping-the-error-handling/comment-page-1/#comment-2660</link>
		<dc:creator>Rafe</dc:creator>
		<pubDate>Tue, 13 May 2008 15:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8233#comment-2660</guid>
		<description>&lt;p&gt;Indeed.  That&#039;s fixed now.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Indeed.  That&#8217;s fixed now.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Drimmie</title>
		<link>http://rc3.org/2008/05/13/skipping-the-error-handling/comment-page-1/#comment-2659</link>
		<dc:creator>Rob Drimmie</dc:creator>
		<pubDate>Tue, 13 May 2008 15:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8233#comment-2659</guid>
		<description>&lt;p&gt;It looks like you may have accidentally linked to yourself with the first link?&lt;/p&gt;

&lt;p&gt;http://blog.thinkrelevance.com/2008/4/23/refactoring-from-ceremony-to-essence&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It looks like you may have accidentally linked to yourself with the first link?</p>

<p><a href="http://blog.thinkrelevance.com/2008/4/23/refactoring-from-ceremony-to-essence" rel="nofollow">http://blog.thinkrelevance.com/2008/4/23/refactoring-from-ceremony-to-essence</a></p>]]></content:encoded>
	</item>
</channel>
</rss>
