ratchetio 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/generators/ratchetio/templates/initializer.rb +2 -0
- data/lib/ratchetio/version.rb +1 -1
- data/lib/ratchetio.rb +12 -7
- metadata +2 -2
data/README.md
CHANGED
@@ -91,12 +91,12 @@ By default, all exceptions reported through `Ratchetio.report_exception()` are r
|
|
91
91
|
- AbstractController::ActionNotFound
|
92
92
|
- ActionController::RoutingError
|
93
93
|
|
94
|
-
If you'd like to customize this list, see the example code in `config/initializers/ratchetio.rb`. Supported levels: "critical", "error", "warning", "info", "debug".
|
94
|
+
If you'd like to customize this list, see the example code in `config/initializers/ratchetio.rb`. Supported levels: "critical", "error", "warning", "info", "debug", "ignore". Set to "ignore" to cause the exception not to be reported at all.
|
95
95
|
|
96
96
|
|
97
97
|
## Help / Support
|
98
98
|
|
99
|
-
If you run into any issues, please email
|
99
|
+
If you run into any issues, please email us at `support@ratchet.io`
|
100
100
|
|
101
101
|
## Contributing
|
102
102
|
|
@@ -14,5 +14,7 @@ Ratchetio.configure do |config|
|
|
14
14
|
# change the level that exception is reported at. Note that if an exception
|
15
15
|
# has already been reported and logged the level will need to be changed
|
16
16
|
# via the ratchet.io interface.
|
17
|
+
# Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
|
18
|
+
# 'ignore' will cause the exception to not be reported at all.
|
17
19
|
# config.exception_level_filters.merge!('MyCriticalException' => 'critical')
|
18
20
|
end
|
data/lib/ratchetio/version.rb
CHANGED
data/lib/ratchetio.rb
CHANGED
@@ -21,7 +21,13 @@ module Ratchetio
|
|
21
21
|
|
22
22
|
def report_exception(exception, request_data={}, person_data={})
|
23
23
|
begin
|
24
|
-
|
24
|
+
filtered_level = configuration.exception_level_filters[exception.class.name]
|
25
|
+
if filtered_level == 'ignore'
|
26
|
+
# ignored - do nothing
|
27
|
+
return
|
28
|
+
end
|
29
|
+
|
30
|
+
data = exception_data(exception, filtered_level)
|
25
31
|
if request_data
|
26
32
|
data[:request] = request_data
|
27
33
|
end
|
@@ -57,8 +63,12 @@ module Ratchetio
|
|
57
63
|
|
58
64
|
private
|
59
65
|
|
60
|
-
def exception_data(exception)
|
66
|
+
def exception_data(exception, force_level = nil)
|
61
67
|
data = base_data
|
68
|
+
|
69
|
+
if force_level
|
70
|
+
data[:level] = force_level
|
71
|
+
end
|
62
72
|
|
63
73
|
# parse backtrace
|
64
74
|
frames = []
|
@@ -70,11 +80,6 @@ module Ratchetio
|
|
70
80
|
# reverse so that the order is as ratchet expects
|
71
81
|
frames.reverse!
|
72
82
|
|
73
|
-
filtered_level = configuration.exception_level_filters[exception.class.name]
|
74
|
-
if filtered_level
|
75
|
-
data[:level] = filtered_level
|
76
|
-
end
|
77
|
-
|
78
83
|
data[:body] = {
|
79
84
|
:trace => {
|
80
85
|
:frames => frames,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ 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
|
description: Rails plugin to catch and send exceptions to Ratchet.io
|
15
15
|
email:
|