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

Fix log for documents #803

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading