Skip to content

Commit

Permalink
Merge pull request #2140 from okkez/handle-load-error
Browse files Browse the repository at this point in the history
Handle LoadError properly
  • Loading branch information
repeatedly authored Oct 2, 2018
2 parents f4a6f09 + 05b17c0 commit 3f5643a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/fluent/plugin/parser_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ def configure_json_parser(name)
else
raise "BUG: unknown json parser specified: #{name}"
end
rescue LoadError
rescue LoadError => ex
name = :yajl
log.info "Oj is not installed, and failing back to Yajl for json parser" if log
if log
if /\boj\z/ =~ ex.message
log.info "Oj is not installed, and failing back to Yajl for json parser"
else
log.warn ex.message
end
end
retry
end

Expand Down

0 comments on commit 3f5643a

Please sign in to comment.