File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 88
99import psutil
1010from models_library .error_codes import create_error_code
11+ from servicelib .logging_errors import create_troubleshotting_log_kwargs
1112
1213from ..modules .mounted_fs import MountedVolumes
1314
@@ -105,17 +106,21 @@ async def async_command(
105106 )
106107
107108 except Exception as err : # pylint: disable=broad-except
109+
108110 error_code = create_error_code (err )
111+ error_msg = f"Unexpected error [{ error_code } ]"
109112 _logger .exception (
110- "Process with %s failed unexpectedly [%s]" ,
111- f"{ command = !r} " ,
112- f"{ error_code } " ,
113- extra = {"error_code" : error_code },
113+ ** create_troubleshotting_log_kwargs (
114+ error_msg ,
115+ exception = err ,
116+ error_context = {"command" : command , "proc.returncode" : proc .returncode },
117+ tip = "Process with command failed unexpectily" ,
118+ )
114119 )
115120
116121 return CommandResult (
117122 success = False ,
118- message = f"Unexpected error [ { error_code } ]" ,
123+ message = error_msg ,
119124 command = f"{ command } " ,
120125 elapsed = time .time () - start ,
121126 )
You can’t perform that action at this time.
0 commit comments