Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Should error more gracefully/clearly when getting a 403 #54

Open
thomasjthomasj opened this issue Oct 3, 2016 · 0 comments
Open

Should error more gracefully/clearly when getting a 403 #54

thomasjthomasj opened this issue Oct 3, 2016 · 0 comments

Comments

@thomasjthomasj
Copy link

I'm getting a 403 but it's not immediately obvious as the error I get is this:

Traceback (most recent call last):
  File "scheduler.py", line 218, in run_schedule
    _run(dryrun)
  File "scheduler.py", line 187, in _run
    data_available = report.check_data_availability()
  File "/home/thomas/gastatsdash/Statsdash/report.py", line 143, in check_data_availability
    check = self.data.check_available_data()
  File "/home/thomas/gastatsdash/Statsdash/Youtube/aggregate_data.py", line 42, in check_available_data
    data_available = analytics.data_available(id, self.period.get_end())
  File "/home/thomas/gastatsdash/Statsdash/Youtube/analytics.py", line 106, in data_available
    results['rows']
TypeError: 'NoneType' object has no attribute '__getitem__'

but in the error logs it's a bit clearer:

WARNING 03-10-2016 12-38-33 analytics->execute_query HTTP error 403 occurred:
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

It'd be nice to be able to see this when running the command manually

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant