roqua-support 0.1.14 → 0.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 283954f3f130b821ad3df69490094c4117afe0d7
4
- data.tar.gz: e3e51403c9b74b86754ed04536f2731a47ac4dc4
3
+ metadata.gz: f4788085a81572cc52f7a47204ee8a09b3b3f6f0
4
+ data.tar.gz: 79dbac1200543744c31be14fcf3a1917ad6f8bd3
5
5
  SHA512:
6
- metadata.gz: 0e51b6995e2dd2fe974c7ef00ea4f5d2408950296fb9a90eb28c654f5e1b4dd88fe5f7f961c1767c660218e39f5b35301296c52021252cd1c14275b7874f39b4
7
- data.tar.gz: 03cb728c081c0e926db89b5c8814281c904d4f608c82c17db3764c6f160e317aa0995c2297e58a558681bbed3ded85f10554417fb2a21b128aafa4e24fa22201
6
+ metadata.gz: 83f0fa54714281bee536b2c060de57584dbd30d1abaaa012774460308fb66efffe256d2d7faf10f00ec9e4b21e90ac95fac7a2af54953bf8f71d63cfd54092ad
7
+ data.tar.gz: f4f248b249452af42275bfbdae0492951a8092e1e34e1c2ad40a02291a4a44d16a4618ac85264fcdeaf65b486b78abbf3ee3be9314785b433e11d21d8626d81a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.15 / 2014-11-18
2
+
3
+ * log Airbrake UUID when reporting exceptions
4
+
1
5
  ## 0.1.14 / 2014-11-13
2
6
 
3
7
  * Don't put request data under params
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roqua-support (0.1.14)
4
+ roqua-support (0.1.15)
5
5
  activesupport (>= 3.2, < 5.0)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module Support
3
- VERSION = '0.1.14'
3
+ VERSION = '0.1.15'
4
4
  end
5
5
  end
@@ -12,12 +12,12 @@ module Roqua
12
12
  def self.report(exception, context = {})
13
13
  return if const_defined?(:Rails) and Rails.env.test?
14
14
  parameters, controller = merge_parameters(context)
15
- # Notify Roqua logging
16
- log_exception(exception, parameters)
17
15
  # Notify Airbrake
18
- notify_airbrake(exception, controller, parameters)
16
+ airbrake_id = notify_airbrake(exception, controller, parameters)
19
17
  # Notify AppSignal
20
18
  notify_appsignal(exception, parameters)
19
+ # Notify Roqua logging
20
+ log_exception(exception, parameters, airbrake_id)
21
21
  end
22
22
 
23
23
  private
@@ -38,14 +38,18 @@ module Roqua
38
38
  end
39
39
  end
40
40
 
41
- def self.log_exception(exception, parameters = {})
41
+ def self.log_exception(exception, parameters = {}, airbrake_id = nil)
42
42
  begin
43
43
  if Roqua.respond_to?(:logger)
44
- Roqua.logger.error('roqua.exception',
45
- class_name: exception.class.to_s,
46
- message: exception.message,
47
- backtrace: exception.backtrace,
48
- parameters: parameters)
44
+ exception_info = {class_name: exception.class.to_s,
45
+ message: exception.message,
46
+ parameters: parameters}
47
+ if airbrake_id.present?
48
+ exception_info[:airbrake_notification] = "https://airbrake.io/locate/#{airbrake_id}"
49
+ else
50
+ exception_info[:backtrace] = exception.backtrace
51
+ end
52
+ Roqua.logger.error('roqua.exception', exception_info)
49
53
  end
50
54
  rescue Exception
51
55
  end
@@ -26,6 +26,17 @@ describe 'Error reporting' do
26
26
  Roqua::Support::Errors.report exception
27
27
  end
28
28
 
29
+ it 'sends the airbrake notification id to the eventlog when present' do
30
+ stub_const('Airbrake', double('Airbrake', notify_or_ignore: 'airbrake_notification_uuid'))
31
+ Roqua.logger.should_receive(:error)
32
+ .with('roqua.exception',
33
+ class_name: 'Exception',
34
+ message: 'exception_message',
35
+ airbrake_notification: 'https://airbrake.io/locate/airbrake_notification_uuid',
36
+ parameters: {})
37
+ Roqua::Support::Errors.report exception
38
+ end
39
+
29
40
  context 'when Airbrake is defined' do
30
41
  before do
31
42
  stub_const('Airbrake', double('Airbrake', is_ignored_exception?: false))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport