sentry-raven 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/raven/backtrace.rb +7 -2
- data/lib/raven/client.rb +1 -2
- data/lib/raven/integrations/delayed_job.rb +2 -2
- data/lib/raven/integrations/rack.rb +1 -1
- data/lib/raven/integrations/rake.rb +1 -1
- data/lib/raven/interfaces/message.rb +1 -1
- data/lib/raven/processor/cookies.rb +18 -8
- data/lib/raven/processor/http_headers.rb +18 -5
- data/lib/raven/processor/post_data.rb +14 -3
- data/lib/raven/processor/removestacktrace.rb +17 -6
- data/lib/raven/transports/http.rb +3 -1
- data/lib/raven/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe631150dba3e7d468ec1b82dce90c833efe4e09
|
4
|
+
data.tar.gz: 6b362a1faf2b2b17bb4635cbeca461402459428b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82ca336c688dd243a368bb59cca6afb73e5de96828f2dfca286efded734946997cea6f6dcd862d41184d5cfe251f5927d4b7a25fd7fc705841b40662dd131680
|
7
|
+
data.tar.gz: 1e49e8fc891a662fc6043690d5711419f5703a44f2a40c8a5acff9f1696368d52160345f9e575f8e7b965b8d803abd3b5896266702e57256305279dbd2a2bb28
|
data/lib/raven/backtrace.rb
CHANGED
@@ -5,8 +5,12 @@ module Raven
|
|
5
5
|
class Backtrace
|
6
6
|
# Handles backtrace parsing line by line
|
7
7
|
class Line
|
8
|
-
# regexp (
|
9
|
-
RUBY_INPUT_FORMAT =
|
8
|
+
# regexp (optional leading X: on windows, or JRuby9000 class-prefix)
|
9
|
+
RUBY_INPUT_FORMAT = /
|
10
|
+
^ \s* (?: [a-zA-Z]: | uri:classloader: )? ([^:]+ | <.*>):
|
11
|
+
(\d+)
|
12
|
+
(?: :in \s `([^']+)')?$
|
13
|
+
/x
|
10
14
|
|
11
15
|
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
|
12
16
|
JAVA_INPUT_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/
|
@@ -30,6 +34,7 @@ module Raven
|
|
30
34
|
ruby_match = unparsed_line.match(RUBY_INPUT_FORMAT)
|
31
35
|
if ruby_match
|
32
36
|
_, file, number, method = ruby_match.to_a
|
37
|
+
file.sub!(/\.class$/, ".rb")
|
33
38
|
module_name = nil
|
34
39
|
else
|
35
40
|
java_match = unparsed_line.match(JAVA_INPUT_FORMAT)
|
data/lib/raven/client.rb
CHANGED
@@ -97,8 +97,7 @@ module Raven
|
|
97
97
|
def failed_send(e, event)
|
98
98
|
@state.failure
|
99
99
|
if e # exception was raised
|
100
|
-
configuration.logger.error "Unable to record event with remote Sentry server (#{e.class} - #{e.message})"
|
101
|
-
e.backtrace[0..10].each { |line| configuration.logger.error(line) }
|
100
|
+
configuration.logger.error "Unable to record event with remote Sentry server (#{e.class} - #{e.message}):\n#{e.backtrace[0..10].join("\n")}"
|
102
101
|
else
|
103
102
|
configuration.logger.error "Not sending event due to previous failure(s)."
|
104
103
|
end
|
@@ -24,10 +24,10 @@ module Delayed
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
# last_error can be nil
|
27
|
-
extra[:last_error] = job.last_error[0...
|
27
|
+
extra[:last_error] = job.last_error[0...1000] if job.last_error
|
28
28
|
# handlers are YAML objects in strings, we definitely can't
|
29
29
|
# report all of that or the event will get truncated randomly
|
30
|
-
extra[:handler] = job.handler[0...
|
30
|
+
extra[:handler] = job.handler[0...1000] if job.handler
|
31
31
|
|
32
32
|
if job.respond_to?('payload_object') && job.payload_object.respond_to?('job_data')
|
33
33
|
extra[:active_job] = job.payload_object.job_data
|
@@ -101,7 +101,7 @@ module Raven
|
|
101
101
|
# env['SERVER_PROTOCOL']. But we don't want to ignore a valid header
|
102
102
|
# if the request has legitimately sent a Version header themselves.
|
103
103
|
# See: https://github.com/rack/rack/blob/028438f/lib/rack/handler/cgi.rb#L29
|
104
|
-
next if key == 'HTTP_VERSION' && value ==
|
104
|
+
next if key == 'HTTP_VERSION' && value == env_hash['SERVER_PROTOCOL']
|
105
105
|
|
106
106
|
next unless key.start_with?('HTTP_') || %w(CONTENT_TYPE CONTENT_LENGTH).include?(key)
|
107
107
|
# Rack stores headers as HTTP_WHAT_EVER, we need What-Ever
|
@@ -6,7 +6,7 @@ module Rake
|
|
6
6
|
class Application
|
7
7
|
alias orig_display_error_messsage display_error_message
|
8
8
|
def display_error_message(ex)
|
9
|
-
Raven.capture_exception ex, :logger => 'rake', :tags => { 'rake_task' =>
|
9
|
+
Raven.capture_exception ex, :logger => 'rake', :tags => { 'rake_task' => top_level_tasks.join(' ') }
|
10
10
|
orig_display_error_messsage(ex)
|
11
11
|
end
|
12
12
|
end
|
@@ -1,16 +1,26 @@
|
|
1
1
|
module Raven
|
2
2
|
class Processor::Cookies < Processor
|
3
3
|
def process(data)
|
4
|
-
if data[:request]
|
5
|
-
|
6
|
-
data[:request][:cookies] = STRING_MASK if data[:request][:cookies]
|
7
|
-
|
8
|
-
if data[:request][:headers] && data[:request][:headers]["Cookie"]
|
9
|
-
data[:request][:headers]["Cookie"] = STRING_MASK
|
10
|
-
end
|
11
|
-
end
|
4
|
+
process_if_symbol_keys(data) if data[:request]
|
5
|
+
process_if_string_keys(data) if data["request"]
|
12
6
|
|
13
7
|
data
|
14
8
|
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def process_if_symbol_keys(data)
|
13
|
+
data[:request][:cookies] = STRING_MASK if data[:request][:cookies]
|
14
|
+
|
15
|
+
return unless data[:request][:headers] && data[:request][:headers]["Cookie"]
|
16
|
+
data[:request][:headers]["Cookie"] = STRING_MASK
|
17
|
+
end
|
18
|
+
|
19
|
+
def process_if_string_keys(data)
|
20
|
+
data["request"]["cookies"] = STRING_MASK if data["request"]["cookies"]
|
21
|
+
|
22
|
+
return unless data["request"]["headers"] && data["request"]["headers"]["Cookie"]
|
23
|
+
data["request"]["headers"]["Cookie"] = STRING_MASK
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
@@ -10,17 +10,30 @@ module Raven
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def process(data)
|
13
|
-
|
14
|
-
|
15
|
-
data[:request][:headers][k] = STRING_MASK
|
16
|
-
end
|
17
|
-
end
|
13
|
+
process_if_symbol_keys(data) if data[:request]
|
14
|
+
process_if_string_keys(data) if data["request"]
|
18
15
|
|
19
16
|
data
|
20
17
|
end
|
21
18
|
|
22
19
|
private
|
23
20
|
|
21
|
+
def process_if_symbol_keys(data)
|
22
|
+
return unless data[:request][:headers]
|
23
|
+
|
24
|
+
data[:request][:headers].keys.select { |k| fields_re.match(k.to_s) }.each do |k|
|
25
|
+
data[:request][:headers][k] = STRING_MASK
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def process_if_string_keys(data)
|
30
|
+
return unless data["request"]["headers"]
|
31
|
+
|
32
|
+
data["request"]["headers"].keys.select { |k| fields_re.match(k) }.each do |k|
|
33
|
+
data["request"]["headers"][k] = STRING_MASK
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
24
37
|
def matches_regexes?(k)
|
25
38
|
fields_re.match(k.to_s)
|
26
39
|
end
|
@@ -1,11 +1,22 @@
|
|
1
1
|
module Raven
|
2
2
|
class Processor::PostData < Processor
|
3
3
|
def process(data)
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
process_if_symbol_keys(data) if data[:request]
|
5
|
+
process_if_string_keys(data) if data["request"]
|
7
6
|
|
8
7
|
data
|
9
8
|
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def process_if_symbol_keys(data)
|
13
|
+
return unless data[:request][:method] == "POST"
|
14
|
+
data[:request][:data] = STRING_MASK
|
15
|
+
end
|
16
|
+
|
17
|
+
def process_if_string_keys(data)
|
18
|
+
return unless data["request"]["method"] == "POST"
|
19
|
+
data["request"]["data"] = STRING_MASK
|
20
|
+
end
|
10
21
|
end
|
11
22
|
end
|
@@ -1,13 +1,24 @@
|
|
1
1
|
module Raven
|
2
2
|
class Processor::RemoveStacktrace < Processor
|
3
|
-
def process(
|
4
|
-
if
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
def process(data)
|
4
|
+
process_if_symbol_keys(data) if data[:exception]
|
5
|
+
process_if_string_keys(data) if data["exception"]
|
6
|
+
|
7
|
+
data
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def process_if_symbol_keys(data)
|
13
|
+
data[:exception][:values].map do |single_exception|
|
14
|
+
single_exception.delete(:stacktrace) if single_exception[:stacktrace]
|
8
15
|
end
|
16
|
+
end
|
9
17
|
|
10
|
-
|
18
|
+
def process_if_string_keys(data)
|
19
|
+
data["exception"]["values"].map do |single_exception|
|
20
|
+
single_exception.delete("stacktrace") if single_exception["stacktrace"]
|
21
|
+
end
|
11
22
|
end
|
12
23
|
end
|
13
24
|
end
|
@@ -29,7 +29,9 @@ module Raven
|
|
29
29
|
end
|
30
30
|
rescue Faraday::ClientError => ex
|
31
31
|
error_info = ex.message
|
32
|
-
|
32
|
+
if ex.response && ex.response[:headers]['x-sentry-error']
|
33
|
+
error_info += " Error in headers is: #{ex.response[:headers]['x-sentry-error']}"
|
34
|
+
end
|
33
35
|
raise Raven::Error, error_info
|
34
36
|
end
|
35
37
|
|
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.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|