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

Switch date parse error to debug #492

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/feedjira/feed_entry_utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def published
def parse_datetime(string)
DateTime.parse(string).feed_utils_to_gm_time
rescue StandardError => e
Feedjira.logger.warn { "Failed to parse date #{string.inspect}" }
Feedjira.logger.warn(e)
Feedjira.logger.debug("Failed to parse date #{string.inspect}")
Feedjira.logger.debug(e)
nil
end

Expand Down
2 changes: 1 addition & 1 deletion spec/feedjira_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
end

it "does not fail if multiple published dates exist and some are unparseable" do
expect(described_class.logger).to receive(:warn).twice
expect(described_class.logger).to receive(:debug).twice

feed = described_class.parse(sample_invalid_date_format_feed)
expect(feed.title).to eq "Invalid date format feed"
Expand Down