errdo 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/errdo/exception.rb +5 -1
- data/lib/errdo/models/error_env_parser.rb +1 -5
- data/lib/errdo/version.rb +1 -1
- data/lib/errdo.rb +7 -9
- data/lib/generators/templates/errdo.rb +6 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +30 -0
- data/test/dummy/log/test.log +77918 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-a/-apldCPiPwnim43kBuJQ-YT7FwzZ0_FprprS-I-e-Rk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/3w/3wnqNR_kJZSdSpABu1Uu8aRCy50-zmkfam8N9XzfvVk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ed/EdinPD8mIf074M4Xo0QTD2y32-JYodnFw6_n-HB4HEk.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSlCtxGS0S-pH3qtUoujIX59cIJJWYUb2rRGPH0WV-8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/h_/h_eE5ERDLtj-w3BiFatbh6Uqbkjv6-VH0wl8tvuTgXc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/y2/y2ggn509AODHPUgEBbJ4E83Y4dFs-qODISSi-vq7Qgk.cache +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/integrations/errors_integration_test.rb +7 -0
- data/test/integrations/plugins_integration_test.rb +51 -0
- data/test/integrations/views_integration_test.rb +5 -0
- data/test/test_helper.rb +5 -0
- data/test/tmp/config/application.rb +4 -0
- data/test/tmp/config/initializers/errdo.rb +50 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcc8bc45f83d4e56758de834b00faf00248fda69
|
4
|
+
data.tar.gz: d914ab5cb2923b2355b8d8556ed9ebb2a4ffb319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -24819,3 +24819,33 @@ RuntimeError (standard-error):
|
|
24819
24819
|
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 1]]
|
24820
24820
|
[1m[35mErrdo::Error Exists (0.2ms)[0m 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
|
[1m[36m (14.3ms)[0m [1mcommit transaction[0m
|
24822
|
+
|
24823
|
+
|
24824
|
+
Started GET "/static/generic_error" for 127.0.0.1 at 2016-09-18 10:23:14 -0400
|
24825
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
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
|
+
[1m[35mErrdo::Error Load (0.2ms)[0m SELECT "errors".* FROM "errors" WHERE "errors"."backtrace_hash" = ? LIMIT 1 [["backtrace_hash", "trollers/static_controller.rb:7:in `generic_error'standard-errorRuntimeError"]]
|
24844
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
24845
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36mSQL (0.3ms)[0m [1mUPDATE "errors" SET "occurrence_count" = COALESCE("occurrence_count", 0) + 1 WHERE "errors"."id" = ?[0m [["id", 13]]
|
24847
|
+
[1m[35mErrdo::Error Exists (0.1ms)[0m 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
|
+
[1m[36mSQL (0.3ms)[0m [1mUPDATE "errors" SET "occurrence_count" = ?, "last_occurred_at" = ?, "updated_at" = ? WHERE "errors"."id" = ?[0m [["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
|
+
[1m[35mErrdo::Error Exists (0.1ms)[0m 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
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "errors" SET "last_experiencer_id" = ?, "last_experiencer_type" = ?, "updated_at" = ? WHERE "errors"."id" = ?[0m [["last_experiencer_id", nil], ["last_experiencer_type", nil], ["updated_at", "2016-09-18 14:27:41.948433"], ["id", 13]]
|
24851
|
+
[1m[35m (7.9ms)[0m commit transaction
|