newrelic_rpm 3.5.5.38 → 3.5.5.39.beta
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,12 +7,22 @@ module NewRelic::Rack
|
|
7
7
|
def call(env)
|
8
8
|
@app.call(env)
|
9
9
|
rescue Exception => exception
|
10
|
+
NewRelic::Agent.logger.debug "collecting %p: %s" % [ exception.class, exception.message ]
|
10
11
|
request = Rack::Request.new(env)
|
12
|
+
|
11
13
|
if !should_ignore_error?(exception, request)
|
14
|
+
params = begin
|
15
|
+
request.params
|
16
|
+
rescue => err
|
17
|
+
warning = "failed to capture request parameters: %p: %s" % [ err.class, err.message ]
|
18
|
+
NewRelic::Agent.logger.warn(warning)
|
19
|
+
{'error' => warning}
|
20
|
+
end
|
21
|
+
|
12
22
|
NewRelic::Agent.instance.error_collector.notice_error(exception,
|
13
23
|
:uri => request.path,
|
14
24
|
:referer => request.referer,
|
15
|
-
:request_params =>
|
25
|
+
:request_params => params)
|
16
26
|
end
|
17
27
|
raise exception
|
18
28
|
end
|
data/newrelic_rpm.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#-*- coding: utf-8 -*-
|
2
|
-
# GITSHA:
|
2
|
+
# GITSHA: e6ee26a548aeb52344bdcdc6365a6ae46508c106
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "newrelic_rpm"
|
6
|
-
s.version = "3.5.5.
|
6
|
+
s.version = "3.5.5.39.beta"
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [ "Jason Clark", "Sam Goldstein", "Jon Guymon", "Ben Weintraub" ]
|
9
|
-
s.date = "2013-01-
|
9
|
+
s.date = "2013-01-11"
|
10
10
|
s.description = <<-EOS
|
11
11
|
New Relic is a performance management system, developed by New Relic,
|
12
12
|
Inc (http://www.newrelic.com). New Relic provides you with deep
|
@@ -66,6 +66,22 @@ module NewRelic::Rack
|
|
66
66
|
assert(NewRelic::Agent.instance.error_collector.errors.empty?,
|
67
67
|
'noticed an error that should have been ignored')
|
68
68
|
end
|
69
|
+
|
70
|
+
def test_handles_parameter_parsing_exceptions
|
71
|
+
bad_request = stub(:env => {}, :path => '/', :referer => '')
|
72
|
+
bad_request.stubs(:params).raises(TypeError, "can't convert nil into Hash")
|
73
|
+
Rack::Request.stubs(:new).returns(bad_request)
|
74
|
+
|
75
|
+
assert_raise RuntimeError do
|
76
|
+
get '/'
|
77
|
+
end
|
78
|
+
|
79
|
+
assert_equal('unhandled error',
|
80
|
+
NewRelic::Agent.instance.error_collector.errors[0].message)
|
81
|
+
assert_match(/failed to capture request parameters/i,
|
82
|
+
NewRelic::Agent.instance.error_collector.errors[0].params[:request_params]['error'])
|
83
|
+
end
|
84
|
+
|
69
85
|
end
|
70
86
|
end
|
71
87
|
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.5.
|
5
|
-
prerelease:
|
4
|
+
version: 3.5.5.39.beta
|
5
|
+
prerelease: 9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jason Clark
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-01-
|
15
|
+
date: 2013-01-11 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: ! 'New Relic is a performance management system, developed by New Relic,
|
18
18
|
|