Skip to content

Commit

Permalink
add a way to just notify an exceptin without a request, for backgroud…
Browse files Browse the repository at this point in the history
…n processing exceptions

Signed-off-by: Andy Delcambre <[email protected]>
  • Loading branch information
Andy Delcambre committed Jul 15, 2009
1 parent d2e47aa commit eab624f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/merb_hoptoad_notifier/hoptoad_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ def notify_hoptoad(request, session)
end
true
end

def notify_hoptoad_exception(exception)
data = {
:api_key => HoptoadNotifier.api_key,
:error_class => Extlib::Inflection.camelize(exception.class.name),
:error_message => "#{Extlib::Inflection.camelize(exception.class.name)}: #{exception.message}",
:backtrace => exception.backtrace,
:environment => ENV.to_hash
}

data[:environment][:RAILS_ENV] = Merb.env

send_to_hoptoad :notice => default_notice_options.merge(data)
true
end


def send_to_hoptoad(data) #:nodoc:
url = URI.parse("http://hoptoadapp.com:80/notices/")
Expand Down

0 comments on commit eab624f

Please sign in to comment.