sentry-raven 2.2.0 → 2.3.0
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.
- checksums.yaml +4 -4
- data/lib/raven/client.rb +1 -1
- data/lib/raven/configuration.rb +19 -19
- data/lib/raven/event.rb +3 -3
- data/lib/raven/integrations/rails.rb +1 -1
- data/lib/raven/logger.rb +1 -0
- 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: 1d47eee39c7781d07673b21c829027ae9ff2a4e3
|
4
|
+
data.tar.gz: 14406d91d68320529521e749b2392ead1e59a95c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeb178b4827443e9dcfe3bd2299e772d9b0f69c42a8e6a281574dec4152d6f976ebd12b8d2aed490073111ad21624e6443f8bf6829d74dc6e2701eaed6b245f2
|
7
|
+
data.tar.gz: 4cd7b703b9cc39c8e838429daef8a24bb70de46d4397bcb9a93c9c1731b51acd600096e1f9db5a83de4e3a7fe498fa69e48fdb92c75f39b14f1ec01f465a5f07
|
data/lib/raven/client.rb
CHANGED
data/lib/raven/configuration.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'logger'
|
2
1
|
require 'uri'
|
3
2
|
|
4
3
|
module Raven
|
@@ -261,19 +260,16 @@ module Raven
|
|
261
260
|
|
262
261
|
def capture_allowed?(message_or_exc = nil)
|
263
262
|
@errors = []
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
false
|
269
|
-
else
|
270
|
-
true
|
271
|
-
end
|
263
|
+
|
264
|
+
valid? &&
|
265
|
+
capture_in_current_environment? &&
|
266
|
+
capture_allowed_by_callback?(message_or_exc)
|
272
267
|
end
|
273
268
|
# If we cannot capture, we cannot send.
|
274
269
|
alias sending_allowed? capture_allowed?
|
275
270
|
|
276
271
|
def error_messages
|
272
|
+
@errors = [errors[0]] + errors[1..-1].map(&:downcase) # fix case of all but first
|
277
273
|
errors.join(", ")
|
278
274
|
end
|
279
275
|
|
@@ -315,23 +311,27 @@ module Raven
|
|
315
311
|
end
|
316
312
|
|
317
313
|
def capture_in_current_environment?
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
[]
|
322
|
-
end
|
314
|
+
return true unless environments.any? && !environments.include?(current_environment)
|
315
|
+
@errors << "Not configured to send/capture in environment '#{current_environment}'"
|
316
|
+
false
|
323
317
|
end
|
324
318
|
|
325
319
|
def capture_allowed_by_callback?(message_or_exc)
|
326
|
-
return
|
327
|
-
|
320
|
+
return true if !should_capture || message_or_exc.nil? || should_capture.call(*[message_or_exc])
|
321
|
+
@errors << "should_capture returned false"
|
322
|
+
false
|
328
323
|
end
|
329
324
|
|
330
325
|
def valid?
|
331
|
-
|
332
|
-
|
326
|
+
return true if %w(server host path public_key secret_key project_id).all? { |k| public_send(k) }
|
327
|
+
if server
|
328
|
+
%w(server host path public_key secret_key project_id).map do |key|
|
329
|
+
@errors << "No #{key} specified" unless public_send(key)
|
330
|
+
end
|
331
|
+
else
|
332
|
+
@errors << "DSN not set"
|
333
333
|
end
|
334
|
-
|
334
|
+
false
|
335
335
|
end
|
336
336
|
|
337
337
|
# Try to resolve the hostname to an FQDN, but fall back to whatever
|
data/lib/raven/event.rb
CHANGED
@@ -96,17 +96,17 @@ module Raven
|
|
96
96
|
configuration = options[:configuration] || Raven.configuration
|
97
97
|
if exc.is_a?(Raven::Error)
|
98
98
|
# Try to prevent error reporting loops
|
99
|
-
configuration.logger.
|
99
|
+
configuration.logger.debug "Refusing to capture Raven error: #{exc.inspect}"
|
100
100
|
return nil
|
101
101
|
end
|
102
102
|
if configuration[:excluded_exceptions].any? { |x| get_exception_class(x) === exc }
|
103
|
-
configuration.logger.
|
103
|
+
configuration.logger.debug "User excluded error: #{exc.inspect}"
|
104
104
|
return nil
|
105
105
|
end
|
106
106
|
|
107
107
|
new(options) do |evt|
|
108
108
|
evt.configuration = configuration
|
109
|
-
evt.message = "#{exc.class}: #{exc.message}"
|
109
|
+
evt.message = "#{exc.class}: #{exc.message}".byteslice(0...10_000) # Messages limited to 10kb
|
110
110
|
evt.level = options[:level] || :error
|
111
111
|
|
112
112
|
add_exception_interface(evt, exc)
|
@@ -34,8 +34,8 @@ module Raven
|
|
34
34
|
|
35
35
|
config.after_initialize do
|
36
36
|
Raven.configure do |config|
|
37
|
-
config.logger ||= ::Rails.logger
|
38
37
|
config.project_root ||= ::Rails.root
|
38
|
+
config.logger ||= ::Rails.logger
|
39
39
|
config.release ||= config.detect_release # if project_root has changed, need to re-check
|
40
40
|
end
|
41
41
|
|
data/lib/raven/logger.rb
CHANGED
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.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-04 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
|