diff --git a/app/helpers/notices_helper.rb b/app/helpers/notices_helper.rb index cfcc986..ac4e150 100644 --- a/app/helpers/notices_helper.rb +++ b/app/helpers/notices_helper.rb @@ -5,7 +5,6 @@ module NoticesHelper end def line_number_with_link(app, line) - return " ".html_safe if line['number'].blank? if Notice.in_app_backtrace_line?(line) return link_to_github(app, line, line['number']) if app.github_url? if app.issue_tracker && app.issue_tracker.respond_to?(:url_to_file) diff --git a/app/models/err.rb b/app/models/err.rb index 1912417..55fe50d 100644 --- a/app/models/err.rb +++ b/app/models/err.rb @@ -19,10 +19,7 @@ class Err validates_presence_of :klass, :environment - delegate :app, - :resolved?, - :to => :problem - + delegate :app, :resolved?, :to => :problem end diff --git a/app/models/error_report.rb b/app/models/error_report.rb index aa28626..463ac29 100644 --- a/app/models/error_report.rb +++ b/app/models/error_report.rb @@ -1,4 +1,5 @@ require 'digest/md5' +require 'hoptoad_notifier' class ErrorReport attr_reader :klass, :message, :backtrace, :request, :server_environment, :api_key, :notifier diff --git a/app/views/notices/_backtrace.html.haml b/app/views/notices/_backtrace.html.haml index 80f374f..66a7893 100644 --- a/app/views/notices/_backtrace.html.haml +++ b/app/views/notices/_backtrace.html.haml @@ -1,13 +1,13 @@ .window %table.backtrace - lines.each do |line| - - in_app = line['file'].gsub!('[PROJECT_ROOT]','') && !line['file'].match(/^\/vendor\//) - - path = File.dirname(line['file']) + '/' + - path = File.dirname(line['file']) + - path = path == "." ? "" : path + '/' - file = File.basename(line['file']) - %tr{:class => (in_app ? 'in-app' : nil)} - %td.line + %tr + %td.line{:class => (Notice.in_app_backtrace_line?(line) ? 'in-app' : nil)} %span.path>= path - %span.file= "#{file}:" << line_number_with_link(@app, line) + %span.file= line['number'].blank? ? file : ("#{file}:" << line_number_with_link(@app, line)).html_safe → %span.method= line['method'] diff --git a/config/application.rb b/config/application.rb index 4ff9e97..a7656b5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,7 +21,7 @@ module Errbit # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. - config.autoload_paths += [Rails.root.join("app/models/issue_trackers")] + config.autoload_paths += [Rails.root.join("app/models/issue_trackers"), Rails.root.join('lib')] # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. diff --git a/db/migrate/20110905134638_link_errs_to_problems.rb b/db/migrate/20110905134638_link_errs_to_problems.rb index fcda3fa..c142df0 100644 --- a/db/migrate/20110905134638_link_errs_to_problems.rb +++ b/db/migrate/20110905134638_link_errs_to_problems.rb @@ -16,8 +16,8 @@ class LinkErrsToProblems < Mongoid::Migration end end - Rake::Task["errbit:db:update_notices_count"].invoke Rake::Task["errbit:db:update_problem_attrs"].invoke + Rake::Task["errbit:db:update_notices_count"].invoke end def self.down diff --git a/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb b/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb index 89ffca6..80172aa 100644 --- a/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb +++ b/lib/overrides/hoptoad_notifier/hoptoad_notifier.rb @@ -15,8 +15,11 @@ HoptoadNotifier.module_eval do end notice.send("api_key=", app.api_key) # Create notice internally. - # 'to_xml ~> from_xml' provides a data bridge between hoptoad_notifier and Errbit. - ::Notice.from_xml(notice.to_xml) + debugger + + report = ErrorReport.new(notice.to_xml) + report.generate_notice! + logger.info "Internal error was logged to 'Self.Errbit' app." end end diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 10efd54..aa7be44 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -664,20 +664,60 @@ table.deploys td.when { margin: 0; } +table.backtrace { + padding: 8px 0; + background-color: #222; +} + +table.backtrace td { + width: 100%; + padding: 0; + margin: 0; + color: #C7C7C7; + background-color: #222; +} + +table.backtrace td, table.backtrace th { + border-top: none; +} + +/* remove alternating color rules */ +table.backtrace tr:nth-child(2n+1) td { background-color: #222; } +table.backtrace tr:first-child td { border-top: 0; } + +table.backtrace th.line-numbers { + border-bottom: 1px solid #F0F0F0; + font-size: 13px; + text-align: right; + vertical-align: top; + padding: 1px 6px 1px 7px; +} + table.backtrace td.line { - color: #777; /* 47% */ - background-color: #222 !important; - border: none; - padding: 1px 8px; + font-size: 13px; + padding: 2px 8px; + vertical-align: top; + white-space: nowrap; } + table.backtrace td.line .file { - color:#d2d2d2; /* 82% */ + color:#ededed; + font-weight:bold; } table.backtrace td.line .method { - color:#ececec; /* 93% */ + color:#aaa; font-weight:bold; } +table.backtrace td.line.in-app { + color: #2adb2e; + background-color: #2f2f2f; +} + +table.backtrace tr.in-app td.line { color:#156E16; /* 43% */} +table.backtrace tr.in-app td.line .file { color:#2adb2e; /* 76% */} +table.backtrace tr.in-app td.line .method { color:#25C227; /* 86% */} + /* Extra empty rows at top and bottom of table */ table.backtrace tr.padding th, table.backtrace tr.padding td { height: 10px; @@ -686,6 +726,7 @@ table.backtrace tr.padding th, table.backtrace tr.padding td { } + span.click_span { font-size: 0.7em; } @@ -740,7 +781,3 @@ table.errs tr td.message .inline_comment em.commenter { color: #888888; } -table.backtrace tr.in-app td.line { color:#156E16; /* 43% */} -table.backtrace tr.in-app td.line .file { color:#25C227; /* 76% */} -table.backtrace tr.in-app td.line .method { color:#2adb2e; /* 86% */} - -- libgit2 0.21.2