exception_notification_sns 0.1.1 → 0.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed7fcedf2d9c72542426a5772e14e6b0908cb39
|
4
|
+
data.tar.gz: 00e42003cb09a1fb766e685820f333f6adf3b7dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dabda8af83560cce6a88656bcf54a4f8184eae42f103796f0f8a787ab10a0d504ca642bb93a4ffceabee7eec84d783d3e25c826e8fab950023bce4c18a9ef02
|
7
|
+
data.tar.gz: eab94d05fb5c182d424de703fdef52ca7e4801de10606cd54a2b1fb2cefc31929280b0fc6fb3496f6b6a1827f0ebbe75f87462203da675fe7e77b74e8d184c1b
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'exception_notification_sns'
|
5
|
-
s.version = '0.1.
|
5
|
+
s.version = '0.1.2'
|
6
6
|
s.summary = 'exception_notification extension for aws sns v1'
|
7
7
|
s.description = 'exception_notification_sns gem is used for sending application extensions to aws sns. It extends exception_notification gem, uses aws-sdk-v1 gem to push exception notificatons to amazon sns'
|
8
8
|
s.required_ruby_version = '>= 2.2.0'
|
@@ -25,7 +25,6 @@ module ExceptionNotifier
|
|
25
25
|
@request = ::ActionDispatch::Request.new(env) if @kontroller
|
26
26
|
|
27
27
|
@sns_client.publish({
|
28
|
-
subject: compose_subject,
|
29
28
|
topic_arn: @topic_arn,
|
30
29
|
message: compose_message.to_json
|
31
30
|
})
|
@@ -35,16 +34,17 @@ module ExceptionNotifier
|
|
35
34
|
!@sns_client.nil? && !@topic_arn.nil?
|
36
35
|
end
|
37
36
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
def compose_info
|
38
|
+
info = @kontroller ? "#{@kontroller.controller_name}##{@kontroller.action_name}" : ''
|
39
|
+
info << " (#{@exception.class})"
|
40
|
+
info << " #{@exception.message.inspect}"
|
42
41
|
end
|
43
42
|
|
44
43
|
def compose_message
|
45
44
|
message = {
|
45
|
+
info: compose_info,
|
46
46
|
backtrace: @backtrace.to_s,
|
47
|
-
default:
|
47
|
+
default: compose_info
|
48
48
|
}
|
49
49
|
|
50
50
|
message[:request] = {
|
@@ -21,8 +21,8 @@ describe 'SNS Notifer' do
|
|
21
21
|
it 'should compose correct message and subject' do
|
22
22
|
@sns.call(fake_exception)
|
23
23
|
|
24
|
-
|
25
|
-
expect(
|
24
|
+
composed_info = @sns.compose_info
|
25
|
+
expect(composed_info).to eq fake_info
|
26
26
|
|
27
27
|
composed_message = @sns.compose_message
|
28
28
|
expect(composed_message[:backtrace]).not_to be_nil
|
@@ -38,9 +38,9 @@ describe 'SNS Notifer' do
|
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
|
43
|
-
|
41
|
+
def fake_info
|
42
|
+
info = " (#{fake_exception.class})"
|
43
|
+
info << " #{fake_exception.message.inspect}"
|
44
44
|
end
|
45
45
|
|
46
46
|
|