Catch exception if there's no user token
@@ -340,7 +340,7 @@ class ArchiveDownload(Resource):
url = '%s/api/v1/projects/%s/jobs/%s/archive/download?filename=%s' % (c['root_url'], project_id, job_id, filename)
try:
token = encode_user_token(g.token['user']['id'])
- except AttributeError:
+ except Exception:
#public project has no token here.
token = ""
headers = {'Authorization': 'bearer ' + token}
