Skip to content

Commit

Permalink
Merge pull request #803 from yuki0920/debug-key
Browse files Browse the repository at this point in the history
Fix log for documents
  • Loading branch information
yuki0920 authored Oct 6, 2024
2 parents eafeb91 + 6fed947 commit 940fae3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ruby/app/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ def save_summary(date)
params = { date: date, type: 2, 'Subscription-Key': EDINET_API_KEY }
response = Faraday.get(DOC_LIST_URL, params)

Rails.logger.info("Response status: #{response.status}")
Rails.logger.info("Response body: #{response.body}")
unless response.status == 200
Rails.logger.error("status: #{response.status}, body: #{response.body}")
Rails.logger.info("EDINET_API_KEY: #{EDINET_API_KEY}")

raise "#{date}の書類一覧取得に失敗しました" if response.status != 200
raise "#{date}の書類一覧取得に失敗しました"
end

body = JSON.parse(response.body, symbolize_names: true)

Expand Down Expand Up @@ -108,6 +110,8 @@ def download

unless response.status == 200
Rails.logger.error("status: #{response.status}, body: #{response.body}")
Rails.logger.info("EDINET_API_KEY: #{EDINET_API_KEY}")

raise "#{document_id}の書類取得に失敗しました"
end

Expand Down

0 comments on commit 940fae3

Please sign in to comment.