errdo 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07bcc89d4586c5dd1b5c3bd6c9cf13132d32afd9
4
- data.tar.gz: c84bacc9d77132de630d24919b0afebdf18c5ccc
3
+ metadata.gz: bcc8bc45f83d4e56758de834b00faf00248fda69
4
+ data.tar.gz: d914ab5cb2923b2355b8d8556ed9ebb2a4ffb319
5
5
  SHA512:
6
- metadata.gz: 2eaab4b09049c587e3ca5165b8827f750ba95796c7649000f2df8f2700ecd11a08ec3dd96360dfb86d209bc3c9fdb6a90ebdff03f2d5ea1d306a3d2c4c30327a
7
- data.tar.gz: 5c50f7ddfbf6c57d5a128e8652af2fab2680105b394821260679fe28669ec3f2dfe367b225bf6ebaaf7a41d73b7b1f87c026988f3da78c1969c4179c26ee8faa
6
+ metadata.gz: 81a12eabf89eb076dff857bd16ccd22e9eb0057ab79b6286a4de517d0497c350d1aab4477133ba068d0be0391724845402e023bcc1e88fb4b5b8bd7995b3377c
7
+ data.tar.gz: eaa11a4adbf37e7bd2bc8684b0d2428f864ee26c4f1ae107cd86982f5498d422b07917ad5b2727325f02a4bc7584bf8692ed3916baca9336264631f7c6e9fc15
@@ -19,7 +19,11 @@ module Errdo
19
19
  def send_slack_notification(error, parser)
20
20
  if Errdo.slack_notifier
21
21
  messager = Errdo::Models::SlackMessager.new(error, parser)
22
- Errdo.slack_notifier.ping messager.message
22
+ begin
23
+ Errdo.slack_notifier.ping messager.message
24
+ rescue => e
25
+ Rails.logger.error e
26
+ end
23
27
  end
24
28
  end
25
29
 
@@ -54,17 +54,13 @@ module Errdo
54
54
 
55
55
  private
56
56
 
57
- def dirty_words
58
- %w(password passwd password_confirmation secret confirm_password secret_token)
59
- end
60
-
61
57
  def prepare_backtrace(env)
62
58
  env["action_dispatch.exception"].try(:backtrace)
63
59
  end
64
60
 
65
61
  def scrubbed_params(request)
66
62
  params = request.try(:params)
67
- dirty_words.each do |word|
63
+ Errdo.dirty_words.each do |word|
68
64
  params[word] = "..." if params[word]
69
65
  end
70
66
  params
data/lib/errdo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Errdo
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.1'.freeze
3
3
  end
data/lib/errdo.rb CHANGED
@@ -42,6 +42,9 @@ module Errdo
42
42
  # The channel to post the errors to. Default is whatever the default of the integration is
43
43
  mattr_accessor :slack_channel
44
44
  @@slack_channel = nil
45
+
46
+ mattr_accessor :dirty_words
47
+ @@dirty_words = %w(password passwd password_confirmation secret confirm_password secret_token)
45
48
  # rubocop:enable Style/ClassVars
46
49
 
47
50
  # == Authentication ==
@@ -94,15 +97,10 @@ module Errdo
94
97
  if @slack_notifier
95
98
  @slack_notifier
96
99
  elsif slack_webhook
97
- begin
98
- @slack_notifier = Slack::Notifier.new slack_webhook,
99
- channel: slack_channel || nil,
100
- icon_emoji: slack_icon,
101
- username: slack_name
102
- rescue => e
103
- Rails.logger.error e
104
- nil
105
- end
100
+ @slack_notifier = Slack::Notifier.new slack_webhook,
101
+ channel: slack_channel || nil,
102
+ icon_emoji: slack_icon,
103
+ username: slack_name
106
104
  end
107
105
  end
108
106
 
@@ -1,9 +1,13 @@
1
1
  Errdo.setup do |config|
2
+ # Add words to be scrubbed from the params here. By default, this is
3
+ # %w(password passwd password_confirmation secret confirm_password secret_token)
4
+ # So make sure you add on, not replace!
5
+ # Errdo.dirty_words += ["custom_param"]
6
+
7
+ ## == Authorization and Devise integration ==================
2
8
  # If you have the ability to track who's logged in, setting the current_user_method
3
9
  # will allow the logged-in user to be recorded with the error
4
10
  # config.current_user_method = :current_user
5
-
6
- ## == Devise integration ==================
7
11
  # Some form of authentication here is basically necessary for authorization
8
12
  # config.authenticate_with do
9
13
  # warden.authenticate! scope: :user
Binary file
Binary file
@@ -24819,3 +24819,33 @@ RuntimeError (standard-error):
24819
24819
  User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
24820
24820
  Errdo::Error Exists (0.2ms) SELECT 1 AS one FROM "errors" WHERE ("errors"."backtrace_hash" = 'trollers/static_controller.rb:7:in `generic_error''standard-errorRuntimeError' AND "errors"."id" != 13) LIMIT 1
24821
24821
   (14.3ms) commit transaction
24822
+
24823
+
24824
+ Started GET "/static/generic_error" for 127.0.0.1 at 2016-09-18 10:23:14 -0400
24825
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
24826
+ Processing by StaticController#generic_error as HTML
24827
+ Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)
24828
+
24829
+ RuntimeError (standard-error):
24830
+ app/controllers/static_controller.rb:7:in `generic_error'
24831
+
24832
+
24833
+
24834
+
24835
+ Started GET "/static/generic_error" for 127.0.0.1 at 2016-09-18 10:27:41 -0400
24836
+ Processing by StaticController#generic_error as HTML
24837
+ Completed 500 Internal Server Error in 0ms (ActiveRecord: 0.0ms)
24838
+
24839
+ RuntimeError (standard-error):
24840
+ app/controllers/static_controller.rb:7:in `generic_error'
24841
+
24842
+
24843
+ Errdo::Error Load (0.2ms) SELECT "errors".* FROM "errors" WHERE "errors"."backtrace_hash" = ? LIMIT 1 [["backtrace_hash", "trollers/static_controller.rb:7:in `generic_error'standard-errorRuntimeError"]]
24844
+  (0.0ms) begin transaction
24845
+ SQL (0.3ms) INSERT INTO "error_occurrences" ("ip", "user_agent", "query_string", "param_values", "cookie_values", "header_values", "error_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["ip", "127.0.0.1"], ["user_agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.63 Safari/537.36"], ["query_string", ""], ["param_values", "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\ncontroller: static\naction: generic_error\n"], ["cookie_values", "---\n_ga: GA1.1.2096945490.1464561447\n"], ["header_values", "---\nX-Frame-Options: SAMEORIGIN\nX-XSS-Protection: 1; mode=block\nX-Content-Type-Options: nosniff\n"], ["error_id", 13], ["created_at", "2016-09-18 14:27:41.927280"], ["updated_at", "2016-09-18 14:27:41.927280"]]
24846
+ SQL (0.3ms) UPDATE "errors" SET "occurrence_count" = COALESCE("occurrence_count", 0) + 1 WHERE "errors"."id" = ? [["id", 13]]
24847
+ Errdo::Error Exists (0.1ms) SELECT 1 AS one FROM "errors" WHERE ("errors"."backtrace_hash" = 'trollers/static_controller.rb:7:in `generic_error''standard-errorRuntimeError' AND "errors"."id" != 13) LIMIT 1
24848
+ SQL (0.3ms) UPDATE "errors" SET "occurrence_count" = ?, "last_occurred_at" = ?, "updated_at" = ? WHERE "errors"."id" = ? [["occurrence_count", 7], ["last_occurred_at", "2016-09-18 14:27:41.927280"], ["updated_at", "2016-09-18 14:27:41.940372"], ["id", 13]]
24849
+ Errdo::Error Exists (0.1ms) SELECT 1 AS one FROM "errors" WHERE ("errors"."backtrace_hash" = 'trollers/static_controller.rb:7:in `generic_error''standard-errorRuntimeError' AND "errors"."id" != 13) LIMIT 1
24850
+ SQL (0.2ms) UPDATE "errors" SET "last_experiencer_id" = ?, "last_experiencer_type" = ?, "updated_at" = ? WHERE "errors"."id" = ? [["last_experiencer_id", nil], ["last_experiencer_type", nil], ["updated_at", "2016-09-18 14:27:41.948433"], ["id", 13]]
24851
+  (7.9ms) commit transaction