Fixed some error messages

This commit is contained in:
Diptanu Choudhury 2016-08-10 15:17:32 -07:00
parent 1b74f863fe
commit 28b3f511e0
3 changed files with 8 additions and 8 deletions

View File

@ -203,7 +203,7 @@ func (r *AllocRunner) saveAllocRunnerState() error {
func (r *AllocRunner) saveTaskRunnerState(tr *TaskRunner) error {
if err := tr.SaveState(); err != nil {
return fmt.Errorf("client: failed to save state for alloc %s task '%s': %v",
return fmt.Errorf("failed to save state for alloc %s task '%s': %v",
r.alloc.ID, tr.task.Name, err)
}
return nil

View File

@ -344,7 +344,7 @@ func (c *Client) RPC(method string, args interface{}, reply interface{}) error {
// Make the RPC request
if err := c.connPool.RPC(c.Region(), server.Addr, c.RPCMajorVersion(), method, args, reply); err != nil {
c.rpcProxy.NotifyFailedServer(server)
return fmt.Errorf("client: RPC failed to server %s: %v", server.Addr, err)
return fmt.Errorf("RPC failed to server %s: %v", server.Addr, err)
}
return nil
}
@ -835,7 +835,7 @@ func (c *Client) registerNode() error {
var resp structs.NodeUpdateResponse
if err := c.RPC("Node.Register", &req, &resp); err != nil {
if time.Since(c.start) > registerErrGrace {
return fmt.Errorf("client: failed to register node: %v", err)
return fmt.Errorf("failed to register node: %v", err)
}
return err
}
@ -867,7 +867,7 @@ func (c *Client) updateNodeStatus() error {
}
var resp structs.NodeUpdateResponse
if err := c.RPC("Node.UpdateStatus", &req, &resp); err != nil {
return fmt.Errorf("client: failed to update status: %v", err)
return fmt.Errorf("failed to update status: %v", err)
}
if len(resp.EvalIDs) != 0 {
c.logger.Printf("[DEBUG] client: %d evaluations triggered by node update", len(resp.EvalIDs))

View File

@ -147,7 +147,7 @@ func (r *TaskRunner) RestoreState() error {
// Restore fields
if snap.Task == nil {
return fmt.Errorf("client: task runner snapshot include nil Task")
return fmt.Errorf("task runner snapshot include nil Task")
} else {
r.task = snap.Task
}
@ -235,7 +235,7 @@ func (r *TaskRunner) createDriver() (driver.Driver, error) {
driverCtx := driver.NewDriverContext(r.task.Name, r.config, r.config.Node, r.logger, r.taskEnv)
driver, err := driver.NewDriver(r.task.Driver, driverCtx)
if err != nil {
return nil, fmt.Errorf("client: failed to create driver '%s' for alloc %s: %v",
return nil, fmt.Errorf("failed to create driver '%s' for alloc %s: %v",
r.task.Driver, r.alloc.ID, err)
}
return driver, err
@ -464,14 +464,14 @@ func (r *TaskRunner) startTask() error {
// Create a driver
driver, err := r.createDriver()
if err != nil {
return fmt.Errorf("client: failed to create driver of task '%s' for alloc '%s': %v",
return fmt.Errorf("failed to create driver of task '%s' for alloc '%s': %v",
r.task.Name, r.alloc.ID, err)
}
// Start the job
handle, err := driver.Start(r.ctx, r.task)
if err != nil {
return fmt.Errorf("client: failed to start task '%s' for alloc '%s': %v",
return fmt.Errorf("failed to start task '%s' for alloc '%s': %v",
r.task.Name, r.alloc.ID, err)
}