newrelic_rpm 3.5.4.34 → 3.5.4.35.beta

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,14 @@ class NewRelic::NoticedError
17
17
  @message = (exception || '<no message>').to_s
18
18
  end
19
19
 
20
+ unless @message.is_a?(String)
21
+ # In pre-1.9.3, Exception.new({}).to_s.class != String
22
+ # That is, Exception#to_s may not return a String instance if one wasn't
23
+ # passed in upon creation of the Exception. So, try to generate a useful
24
+ # String representation of the exception message, falling back to failsafe
25
+ @message = String(@message.inspect) rescue '<unknown message type>'
26
+ end
27
+
20
28
  # clamp long messages to 4k so that we don't send a lot of
21
29
  # overhead across the wire
22
30
  @message = @message[0..4095] if @message.length > 4096
data/newrelic_rpm.gemspec CHANGED
@@ -1,12 +1,12 @@
1
1
  #-*- coding: utf-8 -*-
2
- # GITSHA: 84fb65c30ecef808f04df97e35487d8a613f76d7
2
+ # GITSHA: c59a6d0650909d58a54124624aef46f555b68ead
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "newrelic_rpm"
6
- s.version = "3.5.4.34"
6
+ s.version = "3.5.4.35.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 = "2012-12-24"
9
+ s.date = "2013-01-03"
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
@@ -1,14 +1,24 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__),'..','test_helper'))
2
2
 
3
3
  class NewRelic::Agent::NoticedErrorTest < Test::Unit::TestCase
4
+ def setup
5
+ @path = 'foo/bar/baz'
6
+ @params = { 'key' => 'val' }
7
+ @time = Time.now
8
+ end
9
+
4
10
  def test_to_collector_array
5
- time = Time.now
6
- error = NewRelic::NoticedError.new('path', {'key' => 'val'},
7
- Exception.new('test exception'), time)
11
+ e = Exception.new('test exception')
12
+ error = NewRelic::NoticedError.new(@path, @params, e, @time)
8
13
  expected = [
9
- (time.to_f * 1000).round, 'path', 'test exception', 'Exception',
10
- {'key' => 'val'}
14
+ (@time.to_f * 1000).round, @path, 'test exception', 'Exception', @params
11
15
  ]
12
16
  assert_equal expected, error.to_collector_array
13
17
  end
18
+
19
+ def test_handles_non_string_exception_messages
20
+ e = Exception.new({ :non => :string })
21
+ error = NewRelic::NoticedError.new(@path, @params, e, @time)
22
+ assert_equal(String, error.message.class)
23
+ end
14
24
  end
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.4.34
5
- prerelease:
4
+ version: 3.5.4.35.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: 2012-12-24 00:00:00.000000000 Z
15
+ date: 2013-01-03 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description: ! 'New Relic is a performance management system, developed by New Relic,
18
18