1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-04 10:47:20 +00:00
Former-commit-id: 55589069c8ed458183d28f32870fdf8f233629c6
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-11 16:14:31 +03:00
parent 3574816e1d
commit c8ed26ee51
8 changed files with 981 additions and 923 deletions

View File

@@ -548,8 +548,14 @@ func (h *routerHandler) FireErrorCode(ctx *context.Context) {
break
}
// not error handler found, write a default message.
ctx.WriteString(context.StatusText(statusCode))
// not error handler found,
// see if failed with a stored error, and if so
// then render it, otherwise write a default message.
if err := ctx.GetErr(); err != nil {
ctx.WriteString(err.Error())
} else {
ctx.WriteString(context.StatusText(statusCode))
}
}
func (h *routerHandler) subdomainAndPathAndMethodExists(ctx *context.Context, t *trie, method, path string) bool {