diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-23 12:45:35 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-23 12:45:35 -0700 |
commit | 95ed603de79c66ff76bfe7e42986a2fc8c7a1fa4 (patch) | |
tree | 1a788b8eba98f0c2e69e5816bac9c7cc09aca96f /modules/caddyhttp/server.go | |
parent | cbb405f6aaee046c9de9ffb4f07ca824d9eedeb1 (diff) |
Improve godocs all around
These will be used in the new automated documentation system
Diffstat (limited to 'modules/caddyhttp/server.go')
-rw-r--r-- | modules/caddyhttp/server.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index 83b90e6..60ce07e 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -97,8 +97,12 @@ type Server struct { // in which they appear in the list. Routes RouteList `json:"routes,omitempty"` - // Errors is how this server will handle errors returned from - // any of the handlers in the primary routes. + // Errors is how this server will handle errors returned from any + // of the handlers in the primary routes. If the primary handler + // chain returns an error, the error along with its recommended + // status code are bubbled back up to the HTTP server which + // executes a separate error route, specified using this property. + // The error routes work exactly like the normal routes. Errors *HTTPErrorConfig `json:"errors,omitempty"` // How to handle TLS connections. @@ -418,6 +422,20 @@ func (ahc AutoHTTPSConfig) Skipped(name string, skipSlice []string) bool { // HTTPErrorConfig determines how to handle errors // from the HTTP handlers. type HTTPErrorConfig struct { + // The routes to evaluate after the primary handler + // chain returns an error. In an error route, extra + // placeholders are available: + // + // {http.error.status_code} + // The recommended HTTP status code + // {http.error.status_text} + // The status text associated with the recommended status code + // {http.error.message} + // The error message + // {http.error.trace} + // The origin of the error + // {http.error.id} + // A short, human-conveyable ID for the error Routes RouteList `json:"routes,omitempty"` } |