mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #36144 from emil2k/node-id-required
Produce errors when empty ids are passed into inspect calls.
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
|
||||
// TaskInspectWithRaw returns the task information and its raw representation..
|
||||
func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
|
||||
if taskID == "" {
|
||||
return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil)
|
||||
if err != nil {
|
||||
return swarm.Task{}, nil, wrapResponseError(err, serverResp, "task", taskID)
|
||||
|
||||
Reference in New Issue
Block a user