1
0
Fork 0
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:
Victor Vieux 2014-02-24 13:58:12 -08:00
commit 4a4915c8ee

View file

@ -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
}