Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle json Encoding::UndefinedConversionError #165

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

marcoadkins
Copy link

This addresses: #159 and #158

Things Done:

  • Pass error logger through to formatter class
  • Add exception handler for encoding errors
  • Force utf 8 encoding and try again to format the event
  • Unit tests

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2020

Codecov Report

Merging #165 into master will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
+ Coverage   92.68%   92.79%   +0.10%     
==========================================
  Files          64       64              
  Lines        1668     1735      +67     
==========================================
+ Hits         1546     1610      +64     
- Misses        122      125       +3     
Impacted Files Coverage Δ
lib/logstash-logger/formatter.rb 96.87% <100.00%> (ø)
lib/logstash-logger/formatter/base.rb 100.00% <100.00%> (ø)
lib/logstash-logger/formatter/json.rb 100.00% <100.00%> (ø)
lib/logstash-logger/formatter/json_lines.rb 100.00% <100.00%> (ø)
lib/logstash-logger/logger.rb 83.60% <100.00%> (ø)
spec/formatter/base_spec.rb 100.00% <100.00%> (ø)
spec/formatter/json_lines_spec.rb 100.00% <100.00%> (ø)
spec/formatter/json_spec.rb 100.00% <100.00%> (ø)
lib/logstash-logger/device/kinesis.rb 88.88% <0.00%> (-5.56%) ⬇️
lib/logstash-logger/device/firehose.rb 88.88% <0.00%> (-5.56%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8f5403...56068e9. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants