Handle null executor cancellations separately from other exceptions

This commit is contained in:
Jake Moshenko 2017-05-15 13:45:44 -04:00
parent 6023e15274
commit 21cb9f1aa1
2 changed files with 9 additions and 2 deletions

View file

@ -5,7 +5,7 @@ from hashlib import sha1
from concurrent.futures import ThreadPoolExecutor
from marketorestpython.client import MarketoClient
from util.asyncwrapper import AsyncExecutorWrapper, NullExecutor
from util.asyncwrapper import AsyncExecutorWrapper, NullExecutor, NullExecutorCancelled
logger = logging.getLogger(__name__)
@ -18,6 +18,8 @@ def build_error_callback(message_when_exception):
def maybe_log_error(response_future):
try:
response_future.result()
except NullExecutorCancelled:
pass
except Exception:
logger.exception('User analytics: %s', message_when_exception)