1
0
mirror of https://github.com/gusaul/grpcox.git synced 2024-12-26 02:40:10 +00:00

handling error in AddProtos

This commit is contained in:
beruangcoklat 2022-05-26 08:00:05 +07:00
parent 8534ee1dc1
commit c2a6f5dd7f

View File

@ -285,8 +285,14 @@ func (r *Resource) AddProtos(protos []Proto) error {
protoPath := filepath.Join(BasePath, r.clientConn.Target()) protoPath := filepath.Join(BasePath, r.clientConn.Target())
err := os.MkdirAll(protoPath, 0777) err := os.MkdirAll(protoPath, 0777)
if os.IsExist(err) { if os.IsExist(err) {
os.RemoveAll(protoPath) err = os.RemoveAll(protoPath)
if err != nil {
return err
}
err = os.MkdirAll(protoPath, 0777) err = os.MkdirAll(protoPath, 0777)
if err != nil {
return err
}
} else if err != nil { } else if err != nil {
return err return err
} }