Skip to content
Snippets Groups Projects
Commit 99369ac4 authored by Henk's avatar Henk
Browse files

support appsignal 3

parent 90fdb3d0
No related branches found
No related tags found
1 merge request!44Add stripped string type, add support for rails 6.1, appsignal 3 and active_interaction 4. Drop support for rails 5.1
......@@ -82,7 +82,10 @@ module Roqua
current_transaction.set_tags(labels)
current_transaction.add_exception(exception)
else
Appsignal.send_error exception, labels, namespace
Appsignal.send_error exception do |transaction|
transaction.set_tags labels
transaction.set_namespace namespace
end
end
end
end
......
......@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'active_interaction', '>= 3.0', '< 5.0'
gem.add_dependency 'naught', '~> 1.0'
gem.add_dependency 'with_advisory_lock', '~> 3.2'
gem.add_dependency 'appsignal', '>= 2.9', '< 2.11'
gem.add_dependency 'appsignal', '>= 2.9', '< 3.1'
gem.add_development_dependency 'bundler', '~> 2.0'
gem.add_development_dependency 'delayed_job_active_record'
......
......@@ -106,16 +106,21 @@ describe 'Error reporting' do
end
it 'defaults to a background job' do
expect(Appsignal).to receive(:send_error).with(exception, {}, Appsignal::Transaction::BACKGROUND_JOB)
transaction = Appsignal::Transaction.new(SecureRandom.uuid, Appsignal::Transaction::FRONTEND, nil)
expect(Appsignal).to receive(:send_error).with(exception).and_yield(transaction)
Roqua::Support::Errors.report exception
expect(transaction.namespace).to eq Appsignal::Transaction::BACKGROUND_JOB
end
it 'it will send an error under the provided category' do
transaction = Appsignal::Transaction.new(SecureRandom.uuid, Appsignal::Transaction::FRONTEND, nil)
expect(Appsignal)
.to receive(:send_error)
.with(exception, {a: 'b'}, Appsignal::Transaction::HTTP_REQUEST)
.with(exception).and_yield(transaction)
Roqua::Support::Errors.report exception, a: 'b', namespace: :web
expect(transaction.namespace).to eq Appsignal::Transaction::HTTP_REQUEST
expect(transaction.tags).to eq a: 'b'
end
describe 'when a current transaction is present' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment