Skip to content

Commit 61dc080

Browse files
committed
updates payments log
1 parent 9c54582 commit 61dc080

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

services/payments/src/simcore_service_payments/services/notifier_email.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
from models_library.products import ProductName
1616
from models_library.users import UserID
1717
from pydantic import EmailStr
18-
from servicelib.error_codes import create_error_code
19-
from servicelib.logging_utils import create_troubleshotting_log_message
18+
from servicelib.logging_errors import create_troubleshotting_log_kwargs
2019
from settings_library.email import EmailProtocol, SMTPSettings
2120
from tenacity import (
2221
retry,
@@ -238,20 +237,19 @@ async def _create_user_email(
238237
subtype=sub_type,
239238
)
240239

241-
except Exception as err: # pylint: disable=broad-exception-caught
242-
error_code = create_error_code(err)
243-
error_msg = create_troubleshotting_log_message(
244-
"Cannot attach invoice to payment",
245-
error=err,
246-
error_code=error_code,
247-
error_context={
248-
"user": user,
249-
"payment": payment,
250-
"product": product,
251-
},
252-
tip=f"Check downloading: `wget -v {payment.invoice_pdf_url}`",
240+
except Exception as exc: # pylint: disable=broad-exception-caught
241+
_logger.exception(
242+
**create_troubleshotting_log_kwargs(
243+
"Cannot attach invoice to payment",
244+
exception=exc,
245+
error_context={
246+
"user": user,
247+
"payment": payment,
248+
"product": product,
249+
},
250+
tip=f"Check downloading: `wget -v {payment.invoice_pdf_url}`",
251+
)
253252
)
254-
_logger.exception("%s", error_msg)
255253

256254
return email_msg
257255

0 commit comments

Comments
 (0)