Skip to content

Commit

Permalink
reddit error test
Browse files Browse the repository at this point in the history
  • Loading branch information
amancevice committed Feb 6, 2025
1 parent 578d8e8 commit 75f5ce2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions blue/reddit/pop/lib/lib/reddit/brutalism.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def each
http.request(req)
end

res.body.to_h_from_json.symbolize_names.dig(:data, :children).each do |child|
post = Post.new child[:data]
yield post if post.media_urls.any?
begin
res.body.to_h_from_json.symbolize_names.dig(:data, :children).each do |child|
post = Post.new child[:data]
yield post if post.media_urls.any?
end
rescue
logger.error(res.body)
raise
end
end

Expand Down
1 change: 1 addition & 0 deletions blue/reddit/pop/lib/lib/reddit/post.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'json'
require 'ostruct'
require 'time'

module Reddit
Expand Down

0 comments on commit 75f5ce2

Please sign in to comment.