<?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>FRAPI</title>
	<atom:link href="http://getfrapi.com/feed" rel="self" type="application/rss+xml" />
	<link>http://getfrapi.com</link>
	<description>Focus on business logic, not presentation</description>
	<lastBuildDate>Fri, 14 May 2010 14:09:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Throwing Frapi Errors</title>
		<link>http://getfrapi.com/tutorial/34</link>
		<comments>http://getfrapi.com/tutorial/34#comments</comments>
		<pubDate>Thu, 13 May 2010 23:50:33 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[controllers]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://new.getfrapi.com/?p=34</guid>
		<description><![CDATA[Many people have asked us how do you throw an error from a Frapi action? Well it&#8217;s actually quite simple.
As you know when you generate an action in frapi, it generates executeAction(), executeGet(), etc. To throw an exception from your HTTP GET handler you would do something like such:
public function executeGet()
{
    throw [...]]]></description>
			<content:encoded><![CDATA[<p>Many people have asked us how do you throw an error from a Frapi action? Well it&#8217;s actually quite simple.</p>
<p>As you know when you generate an action in frapi, it generates <strong><em>executeAction()</em></strong>, <strong><em>executeGet()</em></strong>, etc. To throw an exception from your HTTP GET handler you would do something like such:</p>
<pre name="code" class="php">public function executeGet()
{
    throw new Frapi_Error('ERROR_CODE', 'The error message to display', 405);
}</pre>
<p>As you can see, one simply has to throw a new <strong><em>Frapi_Error</em></strong> with either 2 or 3 parameters. The first parameter is the error code, the second the message to return to developers and the third, which is an optional parameter, is the HTTP Response code to return with the error.</p>
<p>For instance, the above request would return the following JSON payload:</p>
<pre name="code" class="javascript">{
    "errors":[{
        "message":"The error message to display",
        "name":"ERROR_CODE","at":""
    }]
}</pre>
<p>or if XML is requested it would return the following response:</p>
<pre name="code" class="xml">
            The error message to display
            ERROR_CODE</pre>
]]></content:encoded>
			<wfw:commentRss>http://getfrapi.com/tutorial/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy to release!</title>
		<link>http://getfrapi.com/release/31</link>
		<comments>http://getfrapi.com/release/31#comments</comments>
		<pubDate>Thu, 13 May 2010 15:00:55 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[release]]></category>
		<category><![CDATA[announcement]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[happy]]></category>
		<category><![CDATA[pre-beta]]></category>

		<guid isPermaLink="false">http://new.getfrapi.com/?p=31</guid>
		<description><![CDATA[This is a very short post to simply say that we are more than delighted to finally announce our official pre-beta release!
]]></description>
			<content:encoded><![CDATA[<p>This is a very short post to simply say that we are more than delighted to finally announce our official pre-beta release!</p>
]]></content:encoded>
			<wfw:commentRss>http://getfrapi.com/release/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
