appygram-rails 1.0.3 → 1.0.4
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.
@@ -8,20 +8,22 @@ module Rack
|
|
8
8
|
@app = app
|
9
9
|
end
|
10
10
|
|
11
|
+
def handle_with_controller(exception, controller, request)
|
12
|
+
unless ::AppygramRails.ignores_exception_class? exception
|
13
|
+
::AppygramRails::Catcher.handle_with_controller(e,env['action_controller.instance'], Rack::Request.new(env))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
11
17
|
def call(env)
|
12
18
|
begin
|
13
19
|
body = @app.call(env)
|
14
20
|
rescue Exception => e
|
15
|
-
|
16
|
-
::AppygramRails::Catcher.handle_with_controller(e,env['action_controller.instance'], Rack::Request.new(env))
|
17
|
-
end
|
21
|
+
handle_with_controller(e,env['action_controller.instance'], Rack::Request.new(env))
|
18
22
|
raise
|
19
23
|
end
|
20
24
|
|
21
25
|
if env['rack.exception']
|
22
|
-
|
23
|
-
::AppygramRails::Catcher.handle_with_controller(env['rack.exception'],env['action_controller.instance'], Rack::Request.new(env))
|
24
|
-
end
|
26
|
+
handle_with_controller(env['rack.exception'],env['action_controller.instance'], Rack::Request.new(env))
|
25
27
|
end
|
26
28
|
|
27
29
|
body
|
data/lib/appygram-rails.rb
CHANGED
@@ -12,4 +12,30 @@ module AppygramRails
|
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
|
+
@@ignored_classes = [
|
16
|
+
'ActiveRecord::RecordNotFound',
|
17
|
+
'ActiveController::RoutingException'
|
18
|
+
]
|
19
|
+
|
20
|
+
class << self
|
21
|
+
|
22
|
+
def report_all_exceptions!
|
23
|
+
@@ignored_classes = []
|
24
|
+
end
|
25
|
+
|
26
|
+
def ignore_exception_class_name!(k)
|
27
|
+
@@ignored_classes << k
|
28
|
+
end
|
29
|
+
|
30
|
+
def ignores_exception_class?(exception)
|
31
|
+
@@ignored_classes.each do |k|
|
32
|
+
if exception.class.name == k
|
33
|
+
return true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
false
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
15
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appygram-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appygram
|
16
|
-
requirement: &
|
16
|
+
requirement: &70136912887380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 1.0.3
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70136912887380
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rack
|
30
|
-
requirement: &
|
30
|
+
requirement: &70136912885960 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70136912885960
|
39
39
|
description: appygram-rails sends uncaught Rails exceptions as traces to the hosted
|
40
40
|
messaging service at http://www.appygram.com
|
41
41
|
email:
|