lib/nfagent/chunk_handler.rb in nfagent-0.9.28 vs lib/nfagent/chunk_handler.rb in nfagent-0.9.29
- old
+ new
@@ -1,6 +1,9 @@
module NFAgent
+ class LookUpError < StandardError; end
+ class IgnoreLine < StandardError; end
+
class ChunkHandler
attr_accessor :chunk_group
def initialize(options = {})
@@ -22,12 +25,16 @@
def append(line)
if Config.parse == 'locally'
parsed = @parser.parse(line)
return if parsed.invalid?
if Config.mode == 'multi'
- key = MapperProxy.find_account_id(parsed.username, parsed.client_ip)
- # TODO: Still appending line as string until Server API has been updated
- return append2(line, key)
+ begin
+ key = MapperProxy.find_account_id(parsed.username, parsed.client_ip)
+ # TODO: Still appending line as string until Server API has been updated
+ return append2(line, key)
+ rescue LookUpError, IgnoreLine
+ return # Do nothing
+ end
end
end
# TODO: rename append2
append2(line)
end