From 59e93b70d0f6ebc9a1a9ab99b1d846cc947a8e00 Mon Sep 17 00:00:00 2001
From: Cyrill Troxler <cyrilltroxler@gmail.com>
Date: Sun, 29 Jul 2018 16:19:26 +0200
Subject: [PATCH] Improve bucket error messages

---
 pkg/s3/controllerserver.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/s3/controllerserver.go b/pkg/s3/controllerserver.go
index 693cb31..fe29f9c 100644
--- a/pkg/s3/controllerserver.go
+++ b/pkg/s3/controllerserver.go
@@ -53,17 +53,17 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
 	params := req.GetParameters()
 	mounter := params[mounterTypeKey]
 
-	glog.V(5).Infof("Got a request to create bucket %s", volumeID)
+	glog.V(4).Infof("Got a request to create volume %s", volumeID)
 
 	exists, err := cs.s3.client.bucketExists(volumeID)
 	if err != nil {
-		return nil, err
+		return nil, fmt.Errorf("failed to check if bucket exists: %v", err)
 	}
 	if exists {
 		var b *bucket
 		b, err = cs.s3.client.getBucket(volumeID)
 		if err != nil {
-			return nil, fmt.Errorf("failed to get bucket: %v", err)
+			return nil, fmt.Errorf("failed to get bucket metadata: %v", err)
 		}
 		// Check if volume capacity requested is bigger than the already existing capacity
 		if capacityBytes > b.CapacityBytes {