1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-05-08 13:07:16 +03:00
parent f33067c1bb
commit 67f5caacf1
6 changed files with 159 additions and 146 deletions

View File

@@ -5,9 +5,9 @@ import (
"github.com/kataras/iris/v12/macro/handler"
)
// DefaultPathTypeParameterErrorHandler registers an error handler for macro path type parameter.
// Register it with Application.Macros().SetErrorHandler(DefaultPathTypeParameterErrorHandler).
var DefaultPathTypeParameterErrorHandler handler.ParamErrorHandler = func(ctx *context.Context, paramIndex int, err error) {
// DefaultPathParameterTypeErrorHandler registers an error handler for macro path type parameter.
// Register it with Application.Macros().SetErrorHandler(DefaultPathParameterTypeErrorHandler).
var DefaultPathParameterTypeErrorHandler handler.ParamErrorHandler = func(ctx *context.Context, paramIndex int, err error) {
param := ctx.Params().GetEntryAt(paramIndex) // key, value fields.
InvalidArgument.DataWithDetails(ctx, "invalid path parameter", err.Error(), param)
}