aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/asset/backend_gcs.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-08-29 14:08:54 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-08-29 16:57:19 +0200
commitdbf801b93d8e458a32a8e88d2bdd8de447338bbf (patch)
tree12d0c7cc4e8495bb97bda09619f4cef5581d8e31 /pkg/asset/backend_gcs.go
parentba6652b6b4e6148d4ab8ba583f0a88a48293130f (diff)
pkg/asset: return the proper error when a GCS object exists
The caller expects a FileExistsError error.
Diffstat (limited to 'pkg/asset/backend_gcs.go')
-rw-r--r--pkg/asset/backend_gcs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/asset/backend_gcs.go b/pkg/asset/backend_gcs.go
index 3cbe445ee..6690ee3e9 100644
--- a/pkg/asset/backend_gcs.go
+++ b/pkg/asset/backend_gcs.go
@@ -62,10 +62,10 @@ func (csb *cloudStorageBackend) upload(req *uploadRequest) (*uploadResponse, err
// complicated error-during-write handling.
exists, err := csb.client.FileExists(path)
if err != nil {
- return nil, &FileExistsError{req.savePath}
+ return nil, err
}
if exists {
- return nil, ErrAssetExists
+ return nil, &FileExistsError{req.savePath}
}
w, err := csb.client.FileWriterExt(path, req.contentType, req.contentEncoding)
csb.tracer.Log("gcs upload: obtained a writer for %s, error %s", path, err)