restful_resource_bugsnag 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fa726b82cf17e9667a63a36e6f314b583535bee
4
- data.tar.gz: b6455f7173395ce016c770d01ee1b745f6e0be12
3
+ metadata.gz: 53cc8cd337f021dbc22ada416bc6d622aa800b10
4
+ data.tar.gz: 5a6671de593b18a50c056cf2b8d300ae12145926
5
5
  SHA512:
6
- metadata.gz: caf649b89648083a3852fe9bab064b89016f1db5f7017396f61a465e36a82c384802020a765825330b127d034ce9809926b66cd10e3bdb1d4c32c98f33f6b80b
7
- data.tar.gz: 54070543ce0e9a5b6cdcf473a8aea3bba466d06a5be698570d3b7089a8c158d4e78984dd6c247170adb2b86b70d79a7c6ae59930d1ae2b633e955de57c82e682
6
+ metadata.gz: 63eae81bb8fed61c43de613da020ade86386faceb435d21b509d5207d4d405d5fd029ffa098aafcce4271f470b7d3de64d5fd0e65821c6d5c79d6badc38343b2
7
+ data.tar.gz: baf0756be76665a1426bb3107546c2f49a4de2668e11a0ff3584e56fa710a644cf90d0bfc8649fa274aa9110cdaed0b7e31b000d4f7d9257d45f28b9d2eece75
@@ -1,3 +1,5 @@
1
+ require 'uri'
2
+
1
3
  module RestfulResourceBugsnag
2
4
  class Middleware
3
5
  def initialize(bugsnag)
@@ -20,7 +22,21 @@ module RestfulResourceBugsnag
20
22
  body: exception.request.body
21
23
  })
22
24
  end
25
+
26
+ # Display the request host in the context so its easy to see in Bugsnag which service was unresponsive
27
+ # Group the errors by host to reduce the amount of error spam
28
+ if exception.is_a?(RestfulResource::HttpClient::ServiceUnavailable)
29
+ notification.context = "HTTP 503: Service unavailable #{request_host_from_exception exception}"
30
+ notification.grouping_hash = notification.context
31
+ end
32
+
23
33
  @bugsnag.call(notification)
24
34
  end
35
+
36
+ private
37
+
38
+ def request_host_from_exception(exception)
39
+ URI.parse(exception.request.url).host
40
+ end
25
41
  end
26
42
  end
@@ -1,3 +1,3 @@
1
1
  module RestfulResourceBugsnag
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,109 +1,109 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_resource_bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - mwagg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2016-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bugsnag
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
- - - ">="
20
+ - - '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.0.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '4.0'
30
- - - ">="
30
+ - - '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.0.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: restful_resource
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ~>
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.12'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ~>
59
59
  - !ruby/object:Gem::Version
60
60
  version: '1.12'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ~>
66
66
  - !ruby/object:Gem::Version
67
67
  version: '10.0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ~>
73
73
  - !ruby/object:Gem::Version
74
74
  version: '10.0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rspec
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ~>
80
80
  - !ruby/object:Gem::Version
81
81
  version: '3.0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: '3.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: webmock
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - ~>
94
94
  - !ruby/object:Gem::Version
95
95
  version: '2.0'
96
- - - ">="
96
+ - - '>='
97
97
  - !ruby/object:Gem::Version
98
98
  version: 2.0.3
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - "~>"
103
+ - - ~>
104
104
  - !ruby/object:Gem::Version
105
105
  version: '2.0'
106
- - - ">="
106
+ - - '>='
107
107
  - !ruby/object:Gem::Version
108
108
  version: 2.0.3
109
109
  description: A Bugsnag middleware which adds extra details to notifications for RestfulResource
@@ -114,8 +114,8 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
- - ".gitignore"
118
- - ".rspec"
117
+ - .gitignore
118
+ - .rspec
119
119
  - CODE_OF_CONDUCT.md
120
120
  - Gemfile
121
121
  - LICENSE.txt
@@ -138,17 +138,17 @@ require_paths:
138
138
  - lib
139
139
  required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ">="
141
+ - - '>='
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - ">="
146
+ - - '>='
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.5.1
151
+ rubygems_version: 2.0.14.1
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: A Bugsnag middleware which adds extra details to notifications for RestfulResource