Skip to content
Snippets Groups Projects
Commit f3da3b24 authored by Douglas Hall's avatar Douglas Hall
Browse files

Added logging to help debug Enterprise API issue.

parent c1c8c20b
No related branches found
Tags release-2020-09-04-14.56
No related merge requests found
......@@ -125,6 +125,7 @@ class EnterpriseApiClient(object):
Initialize an authenticated Enterprise service API client by using the
provided user.
"""
self.user = user
jwt = JwtBuilder(user).build_token([])
self.client = EdxRestApiClient(
configuration_helpers.get_value('ENTERPRISE_API_URL', settings.ENTERPRISE_API_URL),
......@@ -247,10 +248,11 @@ class EnterpriseApiClient(object):
querystring = {'username': user.username}
response = endpoint().get(**querystring)
except (HttpClientError, HttpServerError):
message = ("An error occurred while getting EnterpriseLearner data for user {username}".format(
username=user.username
))
LOGGER.exception(message)
LOGGER.exception(
'Failed to get enterprise-learner for user [%s] with client user [%s]',
user.username,
self.user.username
)
return None
return response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment