1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Remove hardcoded error

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-03-23 20:20:43 +01:00
parent 65e21f5703
commit 8b02d85e17
2 changed files with 2 additions and 7 deletions

View file

@ -20,7 +20,6 @@
package builder
import (
"errors"
"fmt"
"io"
"os"
@ -42,10 +41,6 @@ import (
"github.com/docker/docker/utils"
)
var (
ErrDockerfileEmpty = errors.New("Dockerfile cannot be empty")
)
// Environment variable interpolation will happen on these statements only.
var replaceEnvAllowed = map[string]struct{}{
command.Env: {},
@ -225,7 +220,7 @@ func (b *Builder) readDockerfile() error {
return fmt.Errorf("Cannot locate specified Dockerfile: %s", origFile)
}
if fi.Size() == 0 {
return ErrDockerfileEmpty
return fmt.Errorf("The Dockerfile (%s) cannot be empty", origFile)
}
f, err := os.Open(filename)

View file

@ -3504,7 +3504,7 @@ func TestBuildFailsDockerfileEmpty(t *testing.T) {
defer deleteImages(name)
_, err := buildImage(name, ``, true)
if err != nil {
if !strings.Contains(err.Error(), "Dockerfile cannot be empty") {
if !strings.Contains(err.Error(), "The Dockerfile (Dockerfile) cannot be empty") {
t.Fatalf("Wrong error %v, must be about empty Dockerfile", err)
}
} else {