Skip to content

Conversation

@pe-st
Copy link

@pe-st pe-st commented Sep 6, 2018

  • when DEVICE_DETAIL is empty/None
  • when ACTIVITY_DETAIL gets HTTP error 500
  • when a['activityName'] is None

This should also eliminate the problem of #11.

Error output for the missing DEVICE_DETAIL:

Garmin Connect activity: [2487420533] Some Running
https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/2487420533?full=true
    Downloading file... Activity summary URL: https://connect.garmin.com/modern/proxy/activity-service/activity/2487420533
Device detail URL: https://connect.garmin.com/modern/proxy/device-service/deviceservice/app-info/799988
Writing empty file since there was no GPX activity data...
Traceback (most recent call last):
  File "./gcexport3.py", line 477, in <module>
    DEVICE_DETAIL.decode(),
AttributeError: 'str' object has no attribute 'decode'

Error Output for HTTP error 500 for ACTIVITY_DETAIL:

Garmin Connect activity: [2693805666] Some Running
https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/2693805666?full=true
    Downloading file... Activity summary URL: https://connect.garmin.com/modern/proxy/activity-service/activity/2693805666
Device detail URL: https://connect.garmin.com/modern/proxy/device-service/deviceservice/app-info/845288
Activity details URL: https://connect.garmin.com/modern/proxy/activity-service-1.3/json/activityDetails/2693805666
Traceback (most recent call last):
  File "./gcexport3.py", line 484, in <module>
    ACTIVITY_DETAIL = http_req(URL_GC_ACTIVITY_DETAIL + str(a["activityId"]))
  File "./gcexport3.py", line 151, in http_req
    response = OPENER.open((request), data=post)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

Error Output for missing ActivityName:

Garmin Connect activity: [630980785] None
https://connect.garmin.com/modern/proxy/download-service/export/gpx/activity/630980785?full=true
    Downloading file... Activity summary URL: https://connect.garmin.com/modern/proxy/activity-service/activity/630980785
Device detail URL: https://connect.garmin.com/modern/proxy/device-service/deviceservice/app-info/720039
Activity details URL: https://connect.garmin.com/modern/proxy/activity-service-1.3/json/activityDetails/630980785
Traceback (most recent call last):
  File "./gcexport3.py", line 508, in <module>
    else '"' + a["activityName"].replace('"', '""') + '",'
AttributeError: 'NoneType' object has no attribute 'replace'

- when DEVICE_DETAIL is empty/None
- when ACTIVITY_DETAIL gets HTTP error 500
- when a['activityName'] is None
@tobstarr tobstarr mentioned this pull request Sep 21, 2018
@moderation moderation merged commit 8e84874 into moderation:master Sep 25, 2018
@moderation
Copy link
Owner

Thanks for the updates @pe-st. Just tested and looking good. /cc @tobstarr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants