Skip to content

Commit c2a6f5d

Browse files
committed
handling error in AddProtos
1 parent 8534ee1 commit c2a6f5d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/resource.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ func (r *Resource) AddProtos(protos []Proto) error {
285285
protoPath := filepath.Join(BasePath, r.clientConn.Target())
286286
err := os.MkdirAll(protoPath, 0777)
287287
if os.IsExist(err) {
288-
os.RemoveAll(protoPath)
288+
err = os.RemoveAll(protoPath)
289+
if err != nil {
290+
return err
291+
}
289292
err = os.MkdirAll(protoPath, 0777)
293+
if err != nil {
294+
return err
295+
}
290296
} else if err != nil {
291297
return err
292298
}

0 commit comments

Comments
 (0)