Skip to content

Commit fb2d118

Browse files
authored
Better error message for s2i calls (#3185)
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
1 parent b785e68 commit fb2d118

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/builders/s2i/builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/openshift/source-to-image/pkg/build"
1717
"github.com/openshift/source-to-image/pkg/build/strategies"
1818
s2idocker "github.com/openshift/source-to-image/pkg/docker"
19+
s2iError "github.com/openshift/source-to-image/pkg/errors"
1920
"github.com/openshift/source-to-image/pkg/scm/git"
2021
"knative.dev/func/pkg/builders"
2122
"knative.dev/func/pkg/docker"
@@ -205,6 +206,10 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
205206
if impl == nil {
206207
impl, _, err = strategies.Strategy(client, cfg, build.Overrides{})
207208
if err != nil {
209+
var s2iErr s2iError.Error
210+
if errors.As(err, &s2iErr) {
211+
err = fmt.Errorf("%s: %w", s2iErr.Error(), s2iErr.Details)
212+
}
208213
return fmt.Errorf("cannot create s2i builder: %w", err)
209214
}
210215
}

0 commit comments

Comments
 (0)