@@ -23,6 +23,7 @@ import (
23
23
"github.com/opencontainers/go-digest"
24
24
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
25
25
"github.com/opentracing/opentracing-go"
26
+ "golang.org/x/xerrors"
26
27
27
28
"github.com/gitpod-io/gitpod/common-go/log"
28
29
"github.com/gitpod-io/gitpod/common-go/tracing"
@@ -118,7 +119,7 @@ func (bh *blobHandler) getBlob(w http.ResponseWriter, r *http.Request) {
118
119
// Only if the store fetch fails should we attetmpt to download it.
119
120
manifest , fetcher , err := bh .downloadManifest (ctx , bh .Spec .BaseRef )
120
121
if err != nil {
121
- return err
122
+ return xerrors . Errorf ( "cannnot fetch the manifest: %w" , err )
122
123
}
123
124
124
125
var srcs []BlobSource
@@ -153,7 +154,7 @@ func (bh *blobHandler) getBlob(w http.ResponseWriter, r *http.Request) {
153
154
154
155
dontCache , mediaType , url , rc , err := src .GetBlob (ctx , bh .Spec , bh .Digest )
155
156
if err != nil {
156
- return err
157
+ return xerrors . Errorf ( "cannnot fetch the blob: %w" , err )
157
158
}
158
159
if rc != nil {
159
160
defer rc .Close ()
@@ -174,7 +175,7 @@ func (bh *blobHandler) getBlob(w http.ResponseWriter, r *http.Request) {
174
175
if err != nil {
175
176
bh .Metrics .BlobDownloadCounter .WithLabelValues (src .Name (), "false" ).Inc ()
176
177
log .WithField ("blobSource" , src .Name ()).WithField ("baseRef" , bh .Spec .BaseRef ).WithError (err ).Error ("unable to return blob" )
177
- return err
178
+ return xerrors . Errorf ( "unable to return blob: %w" , err )
178
179
}
179
180
180
181
bh .Metrics .BlobDownloadSpeedHist .WithLabelValues (src .Name ()).Observe (float64 (n ) / time .Since (t0 ).Seconds ())
0 commit comments