Skip to content

Commit

Permalink
Merge pull request #50 from bzwei/parse_error
Browse files Browse the repository at this point in the history
Catch decoding parsing error
  • Loading branch information
agrare committed Jun 30, 2020
2 parents 1718b8b + 561a3c9 commit 5902941
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/manageiq/messaging/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def decode_body(headers, raw_body)
else
raw_body
end
rescue => e # JSON or YAML parsing error
logger.error("Error decoding message body: #{e.message}")
logger.error(e.backtrace.join("\n"))
raw_body
end

def payload_log(payload)
Expand Down
1 change: 1 addition & 0 deletions lib/manageiq/messaging/kafka/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def subscribe_messages_impl(options)
rescue StandardError => e
logger.error("Event processing error: #{e.message}")
logger.error(e.backtrace.join("\n"))
raise
end
logger.info("Batch message processed")
end
Expand Down
1 change: 1 addition & 0 deletions lib/manageiq/messaging/stomp/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def subscribe_messages_impl(options)
rescue => e
logger.error("Message processing error: #{e.message}")
logger.error(e.backtrace.join("\n"))
raise
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/manageiq/messaging/stomp/topic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def subscribe_topic_impl(options)
rescue => e
logger.error("Event processing error: #{e.message}")
logger.error(e.backtrace.join("\n"))
raise
end
end
end
Expand Down

0 comments on commit 5902941

Please sign in to comment.