roqua-support 0.1.2.1 → 0.1.2.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/roqua-support/version.rb +1 -1
- data/lib/roqua/support/errors.rb +7 -5
- data/spec/roqua/support/errors_spec.rb +17 -6
- 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: 0ac53c450b17e874859934e55be62b8ddc7ae00d
|
4
|
+
data.tar.gz: 2f54b672a70529b33ee906ee88788c3f736e98ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144657fabc0578bd624c3e28a098da7c3f8623791c87cf1bb40dd5433bbb21e6179c663c201699bf9ef08f87a712363a54a522c1c7c3b765d567005fd2f4bdc6
|
7
|
+
data.tar.gz: 9f26d2f6fb732c0fc89f54619371d12e45804cff76099f1b708ebfccf63c373c9426a51e89e984197ac64e8eaa890354621583e1e1d46f5a1ee4ce9608fa5bef
|
data/Gemfile.lock
CHANGED
data/lib/roqua/support/errors.rb
CHANGED
@@ -34,11 +34,13 @@ module Roqua
|
|
34
34
|
# this functionality should be supported directly by Appsignal.send_exception.
|
35
35
|
# Appsignal.send_exception(exception, parameters: parameters)
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
if Appsignal.active?
|
38
|
+
transaction = Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
|
39
|
+
transaction.set_tags(parameters)
|
40
|
+
transaction.add_exception(exception)
|
41
|
+
transaction.complete!
|
42
|
+
Appsignal.agent.send_queue
|
43
|
+
end
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
@@ -25,19 +25,30 @@ describe 'Error reporting' do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'sends notifications to airbrake' do
|
28
|
-
stub_const("Airbrake", double("Airbrake"))
|
28
|
+
stub_const("Airbrake", double("Airbrake", is_ignored_exception?: false))
|
29
29
|
Airbrake.should_receive(:notify_or_ignore).with(exception, parameters: {})
|
30
30
|
Roqua::Support::Errors.report exception
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
context 'when Appsignal is loaded' do
|
34
|
+
let(:agent) { double("agent") }
|
35
|
+
let(:transaction) { double("transaction") }
|
36
|
+
|
37
|
+
it 'sends notifications to appsignal' do
|
38
|
+
stub_const("Appsignal", Module.new)
|
39
|
+
Appsignal.stub(is_ignored_exception?: false, agent: agent)
|
40
|
+
stub_const("Appsignal::Transaction", double("Transaction", create: transaction))
|
41
|
+
|
42
|
+
transaction.should_receive(:set_tags).with({})
|
43
|
+
transaction.should_receive(:add_exception).with(exception)
|
44
|
+
transaction.should_receive(:complete!)
|
45
|
+
agent.should_receive(:send_queue)
|
46
|
+
Roqua::Support::Errors.report exception
|
47
|
+
end
|
37
48
|
end
|
38
49
|
|
39
50
|
it 'supports default extra params' do
|
40
|
-
Roqua::Support::Errors.extra_parameters
|
51
|
+
Roqua::Support::Errors.stub(extra_parameters: {organization: 'some_org'})
|
41
52
|
Roqua.logger.should_receive(:error).with('roqua.exception',
|
42
53
|
class_name: 'Exception',
|
43
54
|
message: 'exception_message',
|
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.2.
|
4
|
+
version: 0.1.2.2
|
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-02-
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|