kjkjava / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
314 stars 134 forks source link

Handle HTTP response 204 for GPX format when activity has no GPS data #34

Closed pe-st closed 6 years ago

pe-st commented 7 years ago

I had this error for a couple of activities:

Garmin Connect activity: [436081459] La Berra
        Sun, 26 Jan 2014 10:00, 05:14:09, 9.25 Kilometers
        Downloading file...
Traceback (most recent call last):
  File "./gcexport.py", line 215, in <module>
    data = http_req(download_url)
  File "./gcexport.py", line 74, in http_req
    raise Exception('Bad return code (' + str(response.getcode()) + ') for: ' + url)
Exception: Bad return code (204) for: https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/436081459

I fixed it by writing an empty GPX file in this case