Skip to content

Commit ace09b3

Browse files
Apply suggestions from code review
Co-Authored-By: nickethier <ncethier@gmail.com>
1 parent 6dfa230 commit ace09b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/docker/driver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error {
156156

157157
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *structs.DriverNetwork, error) {
158158
if _, ok := d.tasks.Get(cfg.ID); ok {
159-
return nil, nil, fmt.Errorf("taskConfig with ID '%s' already started", cfg.ID)
159+
return nil, nil, fmt.Errorf("task with ID %q already started", cfg.ID)
160160
}
161161

162162
var driverConfig TaskConfig
@@ -191,7 +191,7 @@ CREATE:
191191
container, err := d.createContainer(client, containerCfg, &driverConfig)
192192
if err != nil {
193193
d.logger.Error("failed to create container", "error", err)
194-
return nil, nil, nstructs.NewRecoverableError(fmt.Errorf("failed to create container: %v", err), nstructs.IsRecoverable(err))
194+
return nil, nil, nstructs.WrapRecoverable(fmt.Sprintf("failed to create container: %v", err), err)
195195
}
196196

197197
d.logger.Info("created container", "container_id", container.ID)
@@ -213,7 +213,7 @@ CREATE:
213213
d.logger.Debug("reattempting container create/start sequence", "attempt", startAttempts, "container_id", id)
214214
goto CREATE
215215
}
216-
return nil, nil, nstructs.NewRecoverableError(fmt.Errorf("Failed to start container %s: %s", container.ID, err), nstructs.IsRecoverable(err))
216+
return nil, nil, nstructs.WrapRecoverable(fmt.Sprintf("Failed to start container %s: %s", container.ID, err), err)
217217
}
218218

219219
// InspectContainer to get all of the container metadata as

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy