mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
minor
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package errors
|
||||
|
||||
import "github.com/kataras/iris/v12/context"
|
||||
import (
|
||||
"github.com/kataras/iris/v12/context"
|
||||
"github.com/kataras/iris/v12/macro/handler"
|
||||
)
|
||||
|
||||
// DefaultPathTypeParameterErrorHandler registers an error handler for macro path type parameter.
|
||||
// Register it with Application.Macros().SetErrorHandler(DefaultPathTypeParameterErrorHandler).
|
||||
func DefaultPathTypeParameterErrorHandler(ctx *context.Context, paramIndex int, err error) {
|
||||
var DefaultPathTypeParameterErrorHandler 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