mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #4312 from shykes/engine-error-reporting
Engine: clearer job error reporting
This commit is contained in:
commit
4a4915c8ee
1 changed files with 5 additions and 2 deletions
|
@ -74,7 +74,7 @@ func (job *Job) Run() error {
|
|||
return err
|
||||
}
|
||||
if job.status != 0 {
|
||||
return fmt.Errorf("%s: %s", job.Name, errorMessage)
|
||||
return fmt.Errorf("%s", errorMessage)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -201,11 +201,14 @@ func (job *Job) Printf(format string, args ...interface{}) (n int, err error) {
|
|||
}
|
||||
|
||||
func (job *Job) Errorf(format string, args ...interface{}) Status {
|
||||
if format[len(format)-1] != '\n' {
|
||||
format = format + "\n"
|
||||
}
|
||||
fmt.Fprintf(job.Stderr, format, args...)
|
||||
return StatusErr
|
||||
}
|
||||
|
||||
func (job *Job) Error(err error) Status {
|
||||
fmt.Fprintf(job.Stderr, "%s", err)
|
||||
fmt.Fprintf(job.Stderr, "%s\n", err)
|
||||
return StatusErr
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue