mirror of https://github.com/hashicorp/consul
Merge pull request #1989 from hashicorp/persist-errors
Fixes some bad error returns in the persist service and check paths.pull/1996/head
commit
178d58721a
|
@ -669,7 +669,7 @@ func (a *Agent) persistService(service *structs.NodeService) error {
|
||||||
}
|
}
|
||||||
encoded, err := json.Marshal(wrapped)
|
encoded, err := json.Marshal(wrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(filepath.Dir(svcPath), 0700); err != nil {
|
if err := os.MkdirAll(filepath.Dir(svcPath), 0700); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -707,7 +707,7 @@ func (a *Agent) persistCheck(check *structs.HealthCheck, chkType *CheckType) err
|
||||||
|
|
||||||
encoded, err := json.Marshal(wrapped)
|
encoded, err := json.Marshal(wrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(filepath.Dir(checkPath), 0700); err != nil {
|
if err := os.MkdirAll(filepath.Dir(checkPath), 0700); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue