sentry-raven 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/raven/context.rb +2 -2
- data/lib/raven/event.rb +24 -5
- data/lib/raven/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c98bcb5d5577e2a88624db5a2cf08c2c903c033
|
4
|
+
data.tar.gz: ad1e3d207fe9930b26218616978298f73ea3ec55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f612c5dd4ae9772f1feeb0462d6f5f95019535ca3790dec9920fabf470cfc4272e604468ea8fc8e8e560f951331a32a1e30e79cbedf488390a63f504347359f
|
7
|
+
data.tar.gz: ed65ecae87b513b51973b38a4ed52be86ef88107859f50497146c5b2bc9f9222804d5776982e99f0e3438d27dc7f09e052e522aa6642990fcaad6be41cdc1770
|
data/lib/raven/context.rb
CHANGED
@@ -10,11 +10,11 @@ module Raven
|
|
10
10
|
Thread.current[:sentry_context] = nil
|
11
11
|
end
|
12
12
|
|
13
|
-
attr_accessor :extra, :
|
13
|
+
attr_accessor :extra, :server_os, :rack_env, :runtime, :tags, :user
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
self.extra = {}
|
17
|
-
self.
|
17
|
+
self.server_os = self.class.os_context
|
18
18
|
self.rack_env = nil
|
19
19
|
self.runtime = self.class.runtime_context
|
20
20
|
self.tags = {}
|
data/lib/raven/event.rb
CHANGED
@@ -26,7 +26,7 @@ module Raven
|
|
26
26
|
attr_accessor :id, :timestamp, :time_spent, :level, :logger,
|
27
27
|
:culprit, :server_name, :release, :modules, :extra, :tags,
|
28
28
|
:context, :configuration, :checksum, :fingerprint, :environment,
|
29
|
-
:
|
29
|
+
:server_os, :runtime, :breadcrumbs, :user, :backtrace
|
30
30
|
|
31
31
|
def initialize(init = {})
|
32
32
|
@configuration = Raven.configuration
|
@@ -44,7 +44,7 @@ module Raven
|
|
44
44
|
@modules = list_gem_specs if @configuration.send_modules
|
45
45
|
@user = {} # TODO: contexts
|
46
46
|
@extra = {} # TODO: contexts
|
47
|
-
@
|
47
|
+
@server_os = {} # TODO: contexts
|
48
48
|
@runtime = {} # TODO: contexts
|
49
49
|
@tags = {} # TODO: contexts
|
50
50
|
@checksum = nil
|
@@ -68,7 +68,7 @@ module Raven
|
|
68
68
|
@user = @context.user.merge(@user) # TODO: contexts
|
69
69
|
@extra = @context.extra.merge(@extra) # TODO: contexts
|
70
70
|
@tags = @configuration.tags.merge(@context.tags).merge(@tags) # TODO: contexts
|
71
|
-
@
|
71
|
+
@server_os = @context.server_os # TODO: contexts
|
72
72
|
@runtime = @context.runtime # TODO: contexts
|
73
73
|
|
74
74
|
# Some type coercion
|
@@ -100,7 +100,7 @@ module Raven
|
|
100
100
|
Raven.logger.info "Refusing to capture Raven error: #{exc.inspect}"
|
101
101
|
return nil
|
102
102
|
end
|
103
|
-
if configuration[:excluded_exceptions].any? { |x| (x === exc
|
103
|
+
if configuration[:excluded_exceptions].any? { |x| get_exception_class(x) === exc }
|
104
104
|
Raven.logger.info "User excluded error: #{exc.inspect}"
|
105
105
|
return nil
|
106
106
|
end
|
@@ -134,6 +134,25 @@ module Raven
|
|
134
134
|
|
135
135
|
private
|
136
136
|
|
137
|
+
def get_exception_class(x)
|
138
|
+
x.is_a?(Module) ? x : qualified_const_get(x)
|
139
|
+
end
|
140
|
+
|
141
|
+
# In Ruby <2.0 const_get can't lookup "SomeModule::SomeClass" in one go
|
142
|
+
def qualified_const_get(x)
|
143
|
+
x = x.to_s
|
144
|
+
parts = x.split("::")
|
145
|
+
parts.reject!(&:empty?)
|
146
|
+
|
147
|
+
if parts.size < 2
|
148
|
+
Object.const_get(x)
|
149
|
+
else
|
150
|
+
parts.inject(Object) { |a, e| a.const_get(e) }
|
151
|
+
end
|
152
|
+
rescue NameError # There's no way to safely ask if a constant exist for an unknown string
|
153
|
+
nil
|
154
|
+
end
|
155
|
+
|
137
156
|
def get_exception_context(exc)
|
138
157
|
if exc.instance_variable_defined?(:@__raven_context)
|
139
158
|
exc.instance_variable_get(:@__raven_context)
|
@@ -231,7 +250,7 @@ module Raven
|
|
231
250
|
:platform => PLATFORM,
|
232
251
|
:sdk => SDK,
|
233
252
|
:contexts => {
|
234
|
-
:
|
253
|
+
:server_os => @server_os,
|
235
254
|
:runtime => @runtime
|
236
255
|
}
|
237
256
|
}
|
data/lib/raven/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-raven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.
|
196
|
+
rubygems_version: 2.6.8
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: A gem that provides a client interface for the Sentry error logger
|