in mapillary_tools/upload.py [0:0]
def _api_logging_failed(user_items: types.UserItem, payload: T.Dict, exc: Exception):
if MAPILLARY_DISABLE_API_LOGGING:
return
payload_with_reason = {**payload, "reason": exc.__class__.__name__}
action: api_v4.ActionType = "upload_failed_upload"
LOG.debug("API Logging for action %s: %s", action, payload)
try:
api_v4.logging(
user_items["user_upload_token"],
action,
payload_with_reason,
)
except requests.HTTPError as exc:
wrapped_exc = uploader.upload_api_v4.wrap_http_exception(exc)
LOG.warning(
"Error from API Logging for action %s",
action,
exc_info=wrapped_exc,
)
except:
LOG.warning("Error from API Logging for action %s", action, exc_info=True)