diff --git a/onevent/on.go b/onevent/on.go index 2e291052b..473cba55d 100644 --- a/onevent/on.go +++ b/onevent/on.go @@ -20,12 +20,15 @@ func setup(c *caddy.Controller) error { } // Register Event Hooks. - c.OncePerServerBlock(func() error { + err = c.OncePerServerBlock(func() error { for _, cfg := range config { caddy.RegisterEventHook("on-"+cfg.ID, cfg.Hook) } return nil }) + if err != nil { + return err + } return nil }