MCPcopy Create free account
hub / github.com/dagger/dagger / make_process_error_msg

Function make_process_error_msg

sdk/python/src/dagger/provisioning/_session.py:276–292  ·  view source on GitHub ↗
(
    proc: subprocess.Popen[str],
    stdout: str | None,
    stderr: str | None,
)

Source from the content-addressed store, hash-verified

274
275
276def make_process_error_msg(
277 proc: subprocess.Popen[str],
278 stdout: str | None,
279 stderr: str | None,
280) -> str:
281 args = cast(list[str], proc.args)
282
283 # Reuse error message from CalledProcessError
284 exc = subprocess.CalledProcessError(proc.returncode, " ".join(args))
285
286 msg = str(exc)
287 detail = stderr or stdout
288 if detail and detail.strip():
289 # `msg` ends in a period, just append
290 msg = f"{msg} {detail.strip()}"
291
292 return msg

Callers 2

_waitMethod · 0.85
get_connect_paramsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected