Base
Error reporting via Hoptoad.
# File lib/daemon_kit/error_handlers/hoptoad.rb, line 39 def clean_exception( exception ) data = { :api_key => self.api_key, :error_class => exception.class.name, :error_message => "#{exception.class.name}: #{exception.message}", :backtrace => exception.backtrace, :environment => ENV.to_hash, :request => {}, :session => {} } stringify_keys( data ) end
# File lib/daemon_kit/error_handlers/hoptoad.rb, line 12 def handle_exception( exception ) headers = { 'Content-type' => 'application/x-yaml', 'Accept' => 'text/xml, application/xml' } http = Net::HTTP.new( url.host, url.port ) data = clean_exception( exception ) response = begin http.post( url.path, {"notice" => data}.to_yaml, headers ) rescue TimeoutError => e DaemonKit.logger.error("Timeout while contacting the Hoptoad server.") nil end case response when Net::HTTPSuccess then DaemonKit.logger.info "Hoptoad Success: #{response.class}" else DaemonKit.logger.error "Hoptoad Failure: #{response.class}\n#{response.body if response.respond_to? :body}" end end
Generated with the Darkfish Rdoc Generator 2.