File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed
services/payments/src/simcore_service_payments/services Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change 1515from models_library .products import ProductName
1616from models_library .users import UserID
1717from 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
2019from settings_library .email import EmailProtocol , SMTPSettings
2120from 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
You can’t perform that action at this time.
0 commit comments