mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
New JWT features and changes (examples updated). Improvements on the Context User and Private Error features
TODO: Write the new e-book JWT section and the HISTORY entry of the chnages and add a simple example on site docs
This commit is contained in:
@@ -129,15 +129,14 @@ type RoutesProvider interface { // api builder
|
||||
}
|
||||
|
||||
func defaultErrorHandler(ctx *context.Context) {
|
||||
if err := ctx.GetErr(); err != nil {
|
||||
if !context.IsErrPrivate(err) {
|
||||
ctx.WriteString(err.Error())
|
||||
return
|
||||
}
|
||||
if ok, err := ctx.GetErrPublic(); ok {
|
||||
// If an error is stored and it's not a private one
|
||||
// write it to the response body.
|
||||
ctx.WriteString(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Otherwise, write the code's text instead.
|
||||
ctx.WriteString(context.StatusText(ctx.GetStatusCode()))
|
||||
|
||||
}
|
||||
|
||||
func (h *routerHandler) Build(provider RoutesProvider) error {
|
||||
|
||||
Reference in New Issue
Block a user