Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
add status code to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
badguy99 committed Apr 30, 2020
1 parent fd0c130 commit 9c061ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/octocost/octocost.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ def calculate_cost_and_usage(self, start):
self.yesterday.isoformat() + 'T23:59:59Z')

if rconsumption.status_code != 200:
self.log('Error getting consumption data: {}'.format(
rconsumption.text), level='ERROR')
if rcost.status_code != 200:
self.log('Error getting cost data: {}'.format(rcost.text),
self.log('Error {} getting consumption data: {}'.format(
rconsumption.status_code, rconsumption.text),
level='ERROR')
if rcost.status_code != 200:
self.log('Error {} getting cost data: {}'.format(
rcost.status_code, rcost.text), level='ERROR')

jconsumption = json.loads(rconsumption.text)
jcost = json.loads(rcost.text)
Expand Down

0 comments on commit 9c061ed

Please sign in to comment.