roqua-support 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/roqua-support/version.rb +1 -1
- data/lib/roqua/support/errors.rb +13 -9
- data/spec/roqua/support/errors_spec.rb +11 -0
- 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: f4788085a81572cc52f7a47204ee8a09b3b3f6f0
|
4
|
+
data.tar.gz: 79dbac1200543744c31be14fcf3a1917ad6f8bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83f0fa54714281bee536b2c060de57584dbd30d1abaaa012774460308fb66efffe256d2d7faf10f00ec9e4b21e90ac95fac7a2af54953bf8f71d63cfd54092ad
|
7
|
+
data.tar.gz: f4f248b249452af42275bfbdae0492951a8092e1e34e1c2ad40a02291a4a44d16a4618ac85264fcdeaf65b486b78abbf3ee3be9314785b433e11d21d8626d81a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/roqua/support/errors.rb
CHANGED
@@ -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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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.
|
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-
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|