summaryrefslogtreecommitdiffhomepage
path: root/sigtrap.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2019-09-30 09:16:01 -0600
committerMatthew Holt <[email protected]>2019-09-30 09:16:01 -0600
commit8eb2c3725199b17ae713dd0756a0e491e4829c12 (patch)
treed368a149518ed7247de4a2571e41aa7a6dbb38c7 /sigtrap.go
parent1e662262179d326586d2beb849f842b82b7324c4 (diff)
downloadcaddy-8eb2c3725199b17ae713dd0756a0e491e4829c12.tar.gz
caddy-8eb2c3725199b17ae713dd0756a0e491e4829c12.zip
Clean up provisioned modules on error; refactor Run(); add Validate()
Modules that return an error during provisioning should still be cleaned up so that they don't leak any resources they may have allocated before the error occurred. Cleanup should be able to run even if Provision does not complete fully.
Diffstat (limited to 'sigtrap.go')
-rw-r--r--sigtrap.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/sigtrap.go b/sigtrap.go
index 8fae706ad..76bb6664a 100644
--- a/sigtrap.go
+++ b/sigtrap.go
@@ -65,9 +65,9 @@ func gracefulStop(sigName string) {
os.Exit(exitCode)
}
-// Exit codes. Generally, you will want to avoid
-// automatically restarting the process if the
-// exit code is 1.
+// Exit codes. Generally, you should NOT
+// automatically restart the process if the
+// exit code is ExitCodeFailedStartup (1).
const (
ExitCodeSuccess = iota
ExitCodeFailedStartup