mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
fix #1882
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user