summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjohncming <[email protected]>2019-03-17 13:33:11 +0800
committerMatt Holt <[email protected]>2019-03-16 23:33:11 -0600
commitf6e6a6be0446a8455001d6202032b20b64b37569 (patch)
tree7ab98f8200779eb8c443c2d7af54d55f373ca70a
parentbc5df3b383ee0add2e7015fabc83f7c8d093b30e (diff)
downloadcaddy-f6e6a6be0446a8455001d6202032b20b64b37569.tar.gz
caddy-f6e6a6be0446a8455001d6202032b20b64b37569.zip
caddy: improve error naming (#2526)
-rw-r--r--caddy.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/caddy.go b/caddy.go
index aa095febf..2aafd3758 100644
--- a/caddy.go
+++ b/caddy.go
@@ -193,9 +193,8 @@ func (i *Instance) Restart(newCaddyfile Input) (*Instance, error) {
r := recover()
if err != nil || r != nil {
for _, fn := range i.OnRestartFailed {
- err2 := fn()
- if err2 != nil {
- log.Printf("[ERROR] Restart failed callback returned error: %v", err2)
+ if err := fn(); err != nil {
+ log.Printf("[ERROR] Restart failed callback returned error: %v", err)
}
}
if err != nil {