hoodoo 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74ed5c7f8e4d541e0fa485aa51d93c35e10e010749e372b1d007ade4550f3ce9
|
4
|
+
data.tar.gz: 236eca0e1da38dce2e63b529f38d7e3d52d75f4685fbaf81341368721f7d4ac7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad755f6aa427b937706e02634b752ec629d6a8ed2c472fb65531eb921d1060d31bbce57a94f20a971a106b681250eb202393135afe9d651f287be47124e5bcca
|
7
|
+
data.tar.gz: a8a3452c1c155825b40696dc7b9f943b28976f2d59255977e94d180bda56b767a670beecd8bf309e327a8bb17c014891614665dd5517e8bbdc0d0794803d0275
|
@@ -57,14 +57,8 @@ module Hoodoo; module Services
|
|
57
57
|
def report( e, env )
|
58
58
|
opts = { :backtrace => Kernel.caller() }
|
59
59
|
opts[ :rack_env ] = env unless env.nil?
|
60
|
-
e = sanitize_object(e)
|
61
|
-
opts = sanitize_object(opts)
|
62
60
|
|
63
|
-
|
64
|
-
# Hoodoo is using threads for behaviour; we don't need the async
|
65
|
-
# Airbrake mechanism to waste resources doing the same.
|
66
|
-
#
|
67
|
-
Airbrake.notify_sync( e, opts )
|
61
|
+
send_synchronously_to_airbrake( e, opts )
|
68
62
|
end
|
69
63
|
|
70
64
|
# Report an exception for errors that occur within a fully handled Rack
|
@@ -83,36 +77,28 @@ module Hoodoo; module Services
|
|
83
77
|
:environment_name => Hoodoo::Services::Middleware.environment,
|
84
78
|
:session => user_data_for( context ) || 'unknown'
|
85
79
|
}
|
86
|
-
e = sanitize_object(e)
|
87
|
-
opts = sanitize_object(opts)
|
88
80
|
|
89
|
-
|
81
|
+
send_synchronously_to_airbrake( e, opts )
|
90
82
|
end
|
91
83
|
|
92
|
-
|
84
|
+
private
|
93
85
|
|
94
|
-
#
|
95
|
-
# the same object in a non frozen state.
|
86
|
+
# Send a report to Airbrake using its synchronous mechanism.
|
96
87
|
#
|
97
|
-
#
|
88
|
+
# Since an ExceptionReporter is already a "slow communicatory",
|
89
|
+
# Hoodoo is using threads for behaviour; we don't need the async
|
90
|
+
# Airbrake mechanism to waste resources doing the same.
|
98
91
|
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
# to Airbrake, ensuring no frozen hash objects are present.
|
92
|
+
# +e+:: Exception (or subclass) instance to be reported.
|
93
|
+
# +params+:: Parameters for <tt>Airbrake#notify_sync</tt>.
|
102
94
|
#
|
103
|
-
#
|
95
|
+
# http://www.rubydoc.info/gems/airbrake-ruby/Airbrake.notify_sync
|
96
|
+
# indicates that the +params+ Hash can contain any data of
|
97
|
+
# interest; it will be shown in the Airbrake dashboard.
|
104
98
|
#
|
105
|
-
def
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
sanitize_hash( object )
|
110
|
-
end
|
111
|
-
|
112
|
-
def sanitize_hash( object )
|
113
|
-
object.each do | key, value |
|
114
|
-
object[key] = sanitize_object( value )
|
115
|
-
end
|
99
|
+
def send_synchronously_to_airbrake( e, params )
|
100
|
+
e = ( e.dup rescue e ) if e.frozen?
|
101
|
+
Airbrake.notify_sync( e, params )
|
116
102
|
end
|
117
103
|
end
|
118
104
|
|
data/lib/hoodoo/version.rb
CHANGED
@@ -12,11 +12,11 @@ module Hoodoo
|
|
12
12
|
# The Hoodoo gem version. If this changes, be sure to re-run
|
13
13
|
# <tt>bundle install</tt> or <tt>bundle update</tt>.
|
14
14
|
#
|
15
|
-
VERSION = '2.2.
|
15
|
+
VERSION = '2.2.1'
|
16
16
|
|
17
17
|
# The Hoodoo gem date. If this changes, be sure to re-run
|
18
18
|
# <tt>bundle install</tt> or <tt>bundle update</tt>.
|
19
19
|
#
|
20
|
-
DATE = '2017-11-
|
20
|
+
DATE = '2017-11-10'
|
21
21
|
|
22
22
|
end
|
@@ -96,11 +96,12 @@ describe Hoodoo::Services::Middleware::ExceptionReporting::AirbrakeReporter do
|
|
96
96
|
|
97
97
|
it 'can send frozen data large enough to require truncation' do
|
98
98
|
ex = RuntimeError.new( 'A' )
|
99
|
-
mock_env = {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
mock_env = {
|
100
|
+
'rack' => 'request',
|
101
|
+
'long' => {
|
102
|
+
'string' => ( '!' * Airbrake::Notice::MAX_NOTICE_SIZE ).freeze
|
103
|
+
}.freeze
|
104
|
+
}
|
104
105
|
|
105
106
|
# See previous test (above) for an explanation of the expectations
|
106
107
|
# below.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoodoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loyalty New Zealand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dalli
|
@@ -234,6 +234,20 @@ dependencies:
|
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '2.6'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: airbrake-ruby
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - "~>"
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '2.6'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - "~>"
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '2.6'
|
237
251
|
- !ruby/object:Gem::Dependency
|
238
252
|
name: airbrake
|
239
253
|
requirement: !ruby/object:Gem::Requirement
|