Skip to content

Commit 2d4cb35

Browse files
author
Inbal Tako
committed
Fix event manager loop
1 parent 8bdfce9 commit 2d4cb35

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/securenative/event_manager.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ def run
8282
begin
8383
item = @queue.shift
8484
res = @http_client.post(item.url, item.body)
85-
if res.code == "401"
85+
if res.code == '401'
8686
item.retry_sending = false
87-
elsif res.code != "200"
87+
elsif res.code != '200'
8888
@queue.append(item)
89+
raise SecureNativeHttpError, res.status_code
8990
end
9091
SecureNativeLogger.debug("Event successfully sent; #{item.body}")
9192
rescue Exception => e

spec/spec_securenative.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
it 'inits sdk with api key and defaults' do
2424
SecureNative::SecureNative._flush
25-
api_key = 'API_KEY'
25+
api_key = "API_KEY"
2626
securenative = SecureNative::SecureNative.init_with_api_key(api_key)
2727
options = securenative.options
2828

0 commit comments

Comments
 (0)