<?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>Big Dave's Blog &#187; hoptoad</title>
	<atom:link href="http://davedupre.com/tag/hoptoad/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedupre.com</link>
	<description>Some random thoughts - Go big or stay home!</description>
	<lastBuildDate>Fri, 25 Jun 2010 15:50:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Checkout Hoptoad by thoughtbot, inc.</title>
		<link>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/</link>
		<comments>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 11:00:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[hoptoad]]></category>
		<category><![CDATA[workling]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=370</guid>
		<description><![CDATA[I&#8217;ve been using Hoptoad for about two months now, and I&#8217;m sold. Hoptoad is a product by thoughbot, inc. Previously, I&#8217;ve always used the excellent exception_notification plugin. The exception_notification plugin is easy to use, and it works great. However, there are a couple of problems with it. You could flood your inbox if there is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hoptoadapp.com/welcome"><img class="alignnone" title="Hoptoad Logo" src="http://hoptoadapp.com/images/logo.png" alt="" width="252" height="94" /></a> I&#8217;ve been using <a href="http://hoptoadapp.com/welcome">Hoptoad</a> for about two months now, and I&#8217;m sold. Hoptoad is a product by <a href="http://www.thoughtbot.com/">thoughbot, inc</a>. Previously, I&#8217;ve always used the excellent <a href="http://github.com/rails/exception_notification/tree/master">exception_notification</a> plugin. The exception_notification plugin is easy to use, and it works great. However, there are a couple of problems with it.</p>
<ol>
<li>You could flood your inbox if there is a bad problem on a popular page.</li>
<li>It&#8217;s difficult to collect all the emails and track errors.</li>
</ol>
<p>Enter Hoptoad. Hoptoad solves both problems, and it is super simple to use and setup. It&#8217;s free for one project and two users. If that isn&#8217;t enough for you, the premium services are very reasonable.</p>
<p>How does it solve both problems? First, Hoptoad will still send you an email when there is an error. However, it won&#8217;t flood your inbox if there are hundreds of the same email. Second, Hoptoad provides a simple web-based system that groups your errors by exception class. That makes it easier to track down problems. Finally, you can mark errors resolved so you don&#8217;t have to wade through noise to solve the real problems.</p>
<p>Hoptoad installation:</p>
<p><strong>REMOVE EXCEPTION_NOTIFIER</strong></p>
<ol>
<li>In your ApplicationController, REMOVE this line:include ExceptionNotifiable</li>
<li>In your config/environment* files, remove all references to ExceptionNotifier.</li>
<li>Remove the vendor/plugins/exception_notifier directory.</li>
</ol>
<p><strong>INSTALL HOPTOAD_NOTIFIER</strong></p>
<p>From your project&#8217;s RAILS_ROOT, run:</p>
<p>script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git</p>
<p><strong>CONFIGURATION</strong></p>
<p>You should have something like this in config/initializers/hoptoad.rb.</p>
<pre>HoptoadNotifier.configure do |config|
  config.api_key = '1234567890abcdef'  # You get your key when you sign up
end</pre>
<p>(Please note that this configuration should be in a global configuration, and is <strong>not</strong> enrivonment-specific. Hoptoad is smart enough to know what errors are caused by what environments, so your staging errors don&#8217;t get mixed in with your production errors.)</p>
<p>Once you do the above, any Exception not caught by your controllers will be sent to Hoptoad where where they can be aggregated, filtered, sorted, analyzed, massaged, and searched.</p>
<p>Now, if you have read anything I&#8217;ve done before, you know I do a lot of asynchronous processing with <a href="http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/">Workling</a>. By default, Hoptoad will not log errors from anything outside of your controllers. Fear not. Hoptoad provides a webservice API to send errors. Here is an example.</p>
<p>In workling/lib/workling/base.rb:</p>
<pre>    # takes care of suppressing remote errors but raising Workling::WorklingNotFoundError
    # where appropriate. swallow workling exceptions so that everything behaves like remote code.
    # otherwise StarlingRunner and SpawnRunner would behave too differently to NotRemoteRunner.
    def dispatch_to_worker_method(method, options)
      begin
        self.send(method, options)
      rescue Exception =&gt; e
        raise e if e.kind_of? Workling::WorklingError
        logger.error "Workling Error: runner could not invoke #{ self.class }:#{ method } with #{ options.inspect }. error was: #{ e.inspect }\n #{ e.backtrace.join("\n") }"
        # DND: Let HopToad know of the issue
        params = options || {}
        HoptoadNotifier.notify(
          :error_class =&gt; "Workling Error - #{e.class.name}",
          :error_message =&gt; "Workling Error(#{e.class.name}): #{e.message}",
          :request =&gt; { :params =&gt; params.merge(:worker_class =&gt; self.class.name, :worker_method =&gt; method) })
        # DND: end of change
      end
    end</pre>
<p>Now, any error not caught by your workers will be sent to Hoptoad for processing. You can use a similar method from Rake tasks or any scripts that run outside of controllers. Remember, Hoptoad will collect errors by :error_class, so you can use different classes to separate errors into bins based on where they came from.</p>
<p>Give Hoptoad a try. You will not be disappointed.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
