1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

accesslog: log error bodies and communicate with the recover middleware

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 14:47:14 +03:00
parent cf0338d342
commit ae67987f55
7 changed files with 142 additions and 15 deletions

View File

@@ -130,10 +130,14 @@ type RoutesProvider interface { // api builder
func defaultErrorHandler(ctx *context.Context) {
if err := ctx.GetErr(); err != nil {
ctx.WriteString(err.Error())
} else {
ctx.WriteString(context.StatusText(ctx.GetStatusCode()))
if !context.IsErrPrivate(err) {
ctx.WriteString(err.Error())
return
}
}
ctx.WriteString(context.StatusText(ctx.GetStatusCode()))
}
func (h *routerHandler) Build(provider RoutesProvider) error {