mirror of
https://github.com/gusaul/grpcox.git
synced 2024-12-25 01:41:11 +00:00
handling error in AddProtos
This commit is contained in:
parent
8534ee1dc1
commit
c2a6f5dd7f
|
@ -285,8 +285,14 @@ func (r *Resource) AddProtos(protos []Proto) error {
|
|||
protoPath := filepath.Join(BasePath, r.clientConn.Target())
|
||||
err := os.MkdirAll(protoPath, 0777)
|
||||
if os.IsExist(err) {
|
||||
os.RemoveAll(protoPath)
|
||||
err = os.RemoveAll(protoPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(protoPath, 0777)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user