cyclone_lariat 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: faa3648b8b458ed7430a3c42e24c883e24b4cce473a298fb453ec64a0471c1fd
4
- data.tar.gz: 4c02a08f6f20a8c1ef3c43b1c86f953005eff6a1d7acc35d55fdaa66a3e852a6
3
+ metadata.gz: 9a416593e31f7f6fd67eb7e453971b5867d9169bdb37e5708876fdea03b8021f
4
+ data.tar.gz: 6ba164622a11d2bd4d63214ba391372bfda1c5447d8979332ef66a4e9e9d2c75
5
5
  SHA512:
6
- metadata.gz: d3c140159b9bfe436de388f6e471f30131bc37d12cc8e8ab37be43657a4c840959d2795ae533521aba73a7b4d518170294f55c46f8693ee026888c0fd971ffc6
7
- data.tar.gz: ba1c7d426dc58f5bff1d3e7ee4768f7b5de09e76f244825c1a20338012e83c6eb656f5139a1852dcab23c6a241081b295c029e87565c2539077f2c26e3039877
6
+ metadata.gz: b7fe001ac8bfc6f373d2f9e7eeb8be68bdea77bca68d4c7b9a7af36c41fd606e82fff5355fc0757e6b4c0b8ca7b00798a7f90c47b3b1a8d141b519389747a117
7
+ data.tar.gz: 19f361ff6fa6509439f8aa6122f743175678c81aee9948b71e5f2fb4e3ab8f852b86920fdcbd656c16a3ac1c30705c4da96c542c2e4a373ab012040544128049
@@ -3,8 +3,6 @@ name: Ruby Gem
3
3
  on:
4
4
  push:
5
5
  branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
8
6
 
9
7
  jobs:
10
8
  build:
data/CHANGELOG.md CHANGED
@@ -4,16 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [0.2.2] - 2021-06-2
7
+ ## [0.2.3] - 2021-06-09
8
+ Added
9
+ - Skip on empty message with error notify
10
+
11
+ ## [0.2.2] - 2021-06-08
8
12
  Changed
9
13
  - Fix save to database
10
14
  - Rename error to client error
11
15
 
12
- ## [0.2.1] - 2021-06-2
13
- Changed
16
+ ## [0.2.1] - 2021-06-02
14
17
  - Fix can load from database if error_details is nil
15
18
 
16
- ## [0.2.0] - 2021-06-2
19
+ ## [0.2.0] - 2021-06-02
17
20
  Added
18
21
  - Complete tests
19
22
  - Production ready
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cyclone_lariat (0.2.2)
4
+ cyclone_lariat (0.2.3)
5
5
  aws-sdk-sns
6
6
  luna_park (~> 0.11)
7
7
 
@@ -5,6 +5,10 @@ require 'luna_park/errors/business'
5
5
 
6
6
  module CycloneLariat
7
7
  module Errors
8
+ class EmptyMessage < LunaPark::Errors::System
9
+ message 'Received message is empty'
10
+ end
11
+
8
12
  class TopicNotFound < LunaPark::Errors::System
9
13
  message { |d| "Could not found topic: `#{d[:expected_topic]}`" }
10
14
  end
@@ -16,6 +16,8 @@ module CycloneLariat
16
16
  log_received_message queue, body
17
17
 
18
18
  catch_standard_error(queue, body) do
19
+ return true unless check(body[:Message])
20
+
19
21
  event = Event.wrap(JSON.parse(body[:Message]))
20
22
 
21
23
  catch_business_error(event) do
@@ -54,5 +56,14 @@ module CycloneLariat
54
56
  errors_notifier&.error(e, queue: queue, aws_message_id: body[:MessageId], message: body[:Message])
55
57
  raise e
56
58
  end
59
+
60
+ def check(msg)
61
+ if msg.nil? || msg.empty?
62
+ errors_notifier&.error(Errors::EmptyMessage.new)
63
+ false
64
+ else
65
+ true
66
+ end
67
+ end
57
68
  end
58
69
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CycloneLariat
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyclone_lariat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kudrin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-08 00:00:00.000000000 Z
12
+ date: 2021-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-sns