Added caller in to the exception message

Added caller in to the exception message to debug ENT-1849
Replaced `get_enterprise_learner_data` method call with `enterprise_customer_for_request` to get enterprise customer data from cache or session instead of hitting API.
This commit is contained in:
Zia Fazal
2019-11-11 19:44:24 +05:00
parent b845fae0bc
commit 5b6e0514de
2 changed files with 6 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ from __future__ import absolute_import
import logging
from functools import wraps
import traceback
from django.conf import settings
from django.contrib.auth.models import User
@@ -256,9 +257,10 @@ class EnterpriseApiClient(object):
response = endpoint().get(**querystring)
except (HttpClientError, HttpServerError):
LOGGER.exception(
u'Failed to get enterprise-learner for user [%s] with client user [%s]',
u'Failed to get enterprise-learner for user [%s] with client user [%s]. Caller: %s',
user.username,
self.user.username
self.user.username,
"".join(traceback.format_stack())
)
return None