Skip to content

Commit

Permalink
Include CommandLine in CreateProcess errors
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Terry <jlterry@amazon.com>
  • Loading branch information
jterry75 committed Apr 20, 2022
1 parent 98519f2 commit 92d99f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/hcs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,13 @@ func (computeSystem *System) createProcess(ctx context.Context, operation string
processInfo, processHandle, resultJSON, err := vmcompute.HcsCreateProcess(ctx, computeSystem.handle, configuration)
events := processHcsResult(ctx, resultJSON)
if err != nil {
if v2, ok := c.(*hcsschema.ProcessParameters); ok {
operation += ": " + v2.CommandLine
} else if v1, ok := c.(*schema1.ProcessConfig); ok {
operation += ": " + v1.CommandLine
} else {
operation += "config " + configuration
}
return nil, nil, makeSystemError(computeSystem, operation, err, events)
}

Expand Down

0 comments on commit 92d99f3

Please sign in to comment.