whoops_rails_notifier 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,11 +7,11 @@ module WhoopsRailsNotifier
|
|
7
7
|
self.service = ::Rails.application.class.name.split("::").first.downcase
|
8
8
|
self.environment = ::Rails.env
|
9
9
|
|
10
|
-
|
10
|
+
add_report_builders
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
self.
|
13
|
+
def add_report_builders
|
14
|
+
self.add_report_builder(:basic_details) do |report, evidence|
|
15
15
|
report.service = self.service
|
16
16
|
report.environment = self.environment
|
17
17
|
report.event_type = "exception"
|
@@ -19,16 +19,19 @@ module WhoopsRailsNotifier
|
|
19
19
|
report.event_time = Time.now
|
20
20
|
end
|
21
21
|
|
22
|
-
self.
|
22
|
+
self.add_report_builder(:details) do |report, evidence|
|
23
23
|
exception = evidence[:exception]
|
24
24
|
rack_env = evidence[:rack_env]
|
25
25
|
|
26
26
|
details = {}
|
27
|
-
details[:backtrace] = exception.backtrace.collect{|
|
27
|
+
details[:backtrace] = exception.backtrace.collect{ |line|
|
28
|
+
line.sub(/^#{ENV['GEM_HOME']}/, '$GEM_HOME').sub(/^#{Rails.root}/, '$Rails.root')
|
29
|
+
}
|
30
|
+
details[:params] = rack_env["action_dispatch.request.parameters"]
|
28
31
|
report.details = details
|
29
32
|
end
|
30
33
|
|
31
|
-
self.
|
34
|
+
self.add_report_builder(:create_event_group_identifier) do |report, evidence|
|
32
35
|
identifier = "#{evidence[:controller]}##{evidence[:action]}"
|
33
36
|
identifier << evidence[:exception].backtrace.collect{|l| l.sub(Rails.root, "")}.join("\n")
|
34
37
|
report.event_group_identifier = Digest::MD5.hexdigest(identifier)
|
@@ -1,22 +1,6 @@
|
|
1
1
|
module WhoopsRailsNotifier
|
2
2
|
# Middleware for Rack applications. Any errors raised by the upstream
|
3
|
-
# application will be delivered to
|
4
|
-
#
|
5
|
-
# Synopsis:
|
6
|
-
#
|
7
|
-
# require 'rack'
|
8
|
-
# require 'hoptoad_notifier'
|
9
|
-
#
|
10
|
-
# HoptoadNotifier.configure do |config|
|
11
|
-
# config.api_key = 'my_api_key'
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# app = Rack::Builder.app do
|
15
|
-
# use HoptoadNotifier::Rack
|
16
|
-
# run lambda { |env| raise "Rack down" }
|
17
|
-
# end
|
18
|
-
#
|
19
|
-
# Use a standard HoptoadNotifier.configure call to configure your api key.
|
3
|
+
# application will be delivered to whoops and re-raised.
|
20
4
|
class Rack
|
21
5
|
def initialize(app)
|
22
6
|
@app = app
|
@@ -34,11 +18,6 @@ module WhoopsRailsNotifier
|
|
34
18
|
raise
|
35
19
|
end
|
36
20
|
|
37
|
-
# if env['rack.exception']
|
38
|
-
# WhoopsRailsNotifier.notify_or_ignore(env['rack.exception'], :rack_env => env)
|
39
|
-
# env['hoptoad.error_id'] = error_id
|
40
|
-
# end
|
41
|
-
|
42
21
|
response
|
43
22
|
end
|
44
23
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whoops_rails_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Higginbotham
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-09 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - "="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 23
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
version: 0.0.
|
33
|
+
- 4
|
34
|
+
version: 0.0.4
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|