Skip to content

Commit cf3f488

Browse files
authored
Merge pull request #178 from IBM/fix-rc
Fix http return code for mount/unmount failure from grpc server
2 parents 1df7889 + 1b3ee7c commit cf3f488

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cos-csi-mounter/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func handleCosMount() gin.HandlerFunc {
127127
err = utils.FuseMount(request.Path, request.Mounter, args)
128128
if err != nil {
129129
logger.Error("mount failed: ", zap.Error(err))
130-
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("mount failed: %v", err)})
130+
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("mount failed: %v", err)})
131131
return
132132
}
133133

@@ -154,7 +154,7 @@ func handleCosUnmount() gin.HandlerFunc {
154154
err := utils.FuseUnmount(request.Path)
155155
if err != nil {
156156
logger.Error("unmount failed: ", zap.Error(err))
157-
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("unmount failed :%v", err)})
157+
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("unmount failed :%v", err)})
158158
return
159159
}
160160

0 commit comments

Comments
 (0)