resource/bundler: Improve error message

This commit is contained in:
Bjørn Erik Pedersen 2018-07-16 10:42:07 +02:00
parent 38204c4ab6
commit 4c240800a4
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -15,7 +15,6 @@
package bundler package bundler
import ( import (
"errors"
"fmt" "fmt"
"io" "io"
"path/filepath" "path/filepath"
@ -71,7 +70,7 @@ func (c *Client) Concat(targetPath string, resources resource.Resources) (resour
// We may improve on that in the future, but then we need to know more. // We may improve on that in the future, but then we need to know more.
for i, r := range resources { for i, r := range resources {
if i > 0 && r.MediaType().Type() != resolvedm.Type() { if i > 0 && r.MediaType().Type() != resolvedm.Type() {
return nil, errors.New("resources in Concat must be of the same Media Type") return nil, fmt.Errorf("resources in Concat must be of the same Media Type, got %q and %q", r.MediaType().Type(), resolvedm.Type())
} }
resolvedm = r.MediaType() resolvedm = r.MediaType()
} }