Add error logging to Marketo calls

This commit is contained in:
Jake Moshenko 2017-04-05 11:25:29 -04:00
parent 2661db7485
commit 22f5934f34
4 changed files with 36 additions and 7 deletions

View file

@ -14,6 +14,16 @@ class LeadNotFoundException(Exception):
pass
def build_error_callback(message_when_exception):
def maybe_log_error(response_future):
try:
response_future.result()
except Exception:
logger.exception('User analytics: %s', message_when_exception)
return maybe_log_error
class _MarketoAnalyticsClient(object):
""" User analytics implementation which will report user changes to the
Marketo API.