From ec456811bb6d61ce32dbe6e4b7580d383f8a4adf Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 13 Apr 2020 09:48:54 -0600 Subject: core: Don't return error on RegisterModule() and RegisterAdapter() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 🤞 --- modules/caddyhttp/app.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/caddyhttp/app.go') 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. -- cgit v1.2.3