Skip to content

Commit 1a2f917

Browse files
authored
Exception handling when adding a mount to the same device (#890)
1 parent 86adfba commit 1a2f917

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

route/v1/recover.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ func GetRecoverStorage(c *gin.Context) {
7171
}
7272
if cf["type"] == "drive" && cf["username"] == dmap["username"] {
7373
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
74-
service.MyService.Storage().CheckAndMountByName(cf["username"])
74+
err := service.MyService.Storage().CheckAndMountByName(v)
75+
if err != nil {
76+
logger.Error("check and mount by name error: ", zap.Error(err), zap.Any("name", cf["username"]))
77+
}
7578
notify["status"] = "warn"
7679
notify["message"] = "The same configuration has been added"
7780
service.MyService.Notify().SendNotify("casaos:file:recover", notify)
@@ -147,7 +150,11 @@ func GetRecoverStorage(c *gin.Context) {
147150
}
148151
if cf["type"] == "dropbox" && cf["username"] == dmap["username"] {
149152
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
150-
service.MyService.Storage().CheckAndMountByName(cf["username"])
153+
err := service.MyService.Storage().CheckAndMountByName(v)
154+
if err != nil {
155+
logger.Error("check and mount by name error: ", zap.Error(err), zap.Any("name", cf["username"]))
156+
}
157+
151158
notify["status"] = "warn"
152159
notify["message"] = "The same configuration has been added"
153160
service.MyService.Notify().SendNotify("casaos:file:recover", notify)

0 commit comments

Comments
 (0)