More stacktrace in logs when failing to generate a payload

merge-requests/159/head
Jason Robinson 2020-02-17 23:54:56 +02:00
rodzic 721a775704
commit 26872a87c3
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ import copy
import importlib
import json
import logging
import traceback
from typing import List, Dict, Union
# noinspection PyPackageRequirements
@ -170,10 +171,10 @@ def handle_send(
if isinstance(payload.get("object"), dict):
payload["object"]["to"] = [fid]
rendered_payload = json.dumps(payload).encode("utf-8")
except Exception as ex:
logger.error("handle_send - failed to generate payload for %s, %s: %s", fid, endpoint, ex)
import traceback
logger.error(traceback.format_exc())
except Exception:
logger.error(
"handle_send - failed to generate payload for %s, %s: %s", fid, endpoint, traceback.format_exc(),
)
continue
payloads.append({
"auth": get_http_authentication(author_user.rsa_private_key, f"{author_user.id}#main-key"),