summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-04-13 09:48:54 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-04-13 09:48:54 -0600
commitec456811bb6d61ce32dbe6e4b7580d383f8a4adf (patch)
tree4d49b468e1677584f47262aafa849b43133d6603 /modules/caddyhttp
parent68cebb28d063a7a71705ce022f118b5e1205fa3f (diff)
core: Don't return error on RegisterModule() and RegisterAdapter()
These functions are called at init-time, and their inputs are hard-coded so there are no environmental or user factors that could make it fail or succeed; the error return values are often ignored, and when they're not, they are usually a fatal error anyway. To ensure that a programmer mistake is not missed, we now panic instead. Last breaking change 🤞
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/app.go5
-rw-r--r--modules/caddyhttp/caddyhttp.go5
2 files changed, 2 insertions, 8 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go
index 292f934..8e7f3ea 100644
--- a/modules/caddyhttp/app.go
+++ b/modules/caddyhttp/app.go
@@ -30,10 +30,7 @@ import (
)
func init() {
- err := caddy.RegisterModule(App{})
- if err != nil {
- caddy.Log().Fatal(err.Error())
- }
+ caddy.RegisterModule(App{})
}
// App is a robust, production-ready HTTP server.
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 6666d3e..6dbf773 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -30,10 +30,7 @@ import (
func init() {
weakrand.Seed(time.Now().UnixNano())
- err := caddy.RegisterModule(tlsPlaceholderWrapper{})
- if err != nil {
- caddy.Log().Fatal(err.Error())
- }
+ caddy.RegisterModule(tlsPlaceholderWrapper{})
}
// RequestMatcher is a type that can match to a request.