Fix error reporting (#128)

Put error back in the correct place in the directives.go. Also don't
make it a pointer. If it *is* a pointer the buildstack function does
not correctly set the Next Handler. Don't understand *why* this is
different from Caddy. Anyway this fixes it, with the caveat that
the error log file is now openend earlier in the startup.

Fixes #127
This commit is contained in:
Miek Gieben
2016-04-19 22:51:23 +01:00
parent a1e6cb7cf4
commit e726dca2ee
3 changed files with 40 additions and 48 deletions

View File

@@ -53,7 +53,9 @@ var directiveOrder = []directive{
// Directives that inject handlers (middleware)
{"prometheus", setup.Prometheus},
{"errors", setup.Errors},
{"log", setup.Log},
{"chaos", setup.Chaos},
{"rewrite", setup.Rewrite},
{"loadbalance", setup.Loadbalance},
@@ -62,7 +64,6 @@ var directiveOrder = []directive{
{"secondary", setup.Secondary},
{"etcd", setup.Etcd},
{"proxy", setup.Proxy},
{"errors", setup.Errors},
}
// RegisterDirective adds the given directive to caddy's list of directives.
@@ -90,5 +91,5 @@ type directive struct {
// SetupFunc takes a controller and may optionally return a middleware.
// If the resulting middleware is not nil, it will be chained into
// the HTTP handlers in the order specified in this package.
// the DNS handlers in the order specified in this package.
type SetupFunc func(c *setup.Controller) (middleware.Middleware, error)