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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user