mirror of
https://github.com/kataras/iris.git
synced 2026-01-19 18:05:58 +00:00
update dependencies
This commit is contained in:
@@ -18,7 +18,7 @@ var (
|
||||
Join = errors.Join
|
||||
)
|
||||
|
||||
func sprintf(format string, args ...interface{}) string {
|
||||
func sprintf(format string, args ...any) string {
|
||||
if len(args) > 0 {
|
||||
return fmt.Sprintf(format, args...)
|
||||
}
|
||||
|
||||
@@ -281,12 +281,12 @@ func (e ErrorCodeName) Details(ctx *context.Context, msg, details string) {
|
||||
}
|
||||
|
||||
// Data sends an error with a message and json data to the client.
|
||||
func (e ErrorCodeName) Data(ctx *context.Context, msg string, data interface{}) {
|
||||
func (e ErrorCodeName) Data(ctx *context.Context, msg string, data any) {
|
||||
fail(ctx, e, msg, "", nil, data)
|
||||
}
|
||||
|
||||
// DataWithDetails sends an error with a message, details and json data to the client.
|
||||
func (e ErrorCodeName) DataWithDetails(ctx *context.Context, msg, details string, data interface{}) {
|
||||
func (e ErrorCodeName) DataWithDetails(ctx *context.Context, msg, details string, data any) {
|
||||
fail(ctx, e, msg, details, nil, data)
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ func (e ErrorCodeName) Validation(ctx *context.Context, validationErrors ...Vali
|
||||
e.validation(ctx, validationErrors)
|
||||
}
|
||||
|
||||
func (e ErrorCodeName) validation(ctx *context.Context, validationErrors interface{}) {
|
||||
func (e ErrorCodeName) validation(ctx *context.Context, validationErrors any) {
|
||||
fail(ctx, e, "validation failure", "fields were invalid", validationErrors, nil)
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ func (e ErrorCodeName) Err(ctx *context.Context, err error) {
|
||||
// error using the "LogError" package-level function, which can be customized.
|
||||
//
|
||||
// See "LogErr" too.
|
||||
func (e ErrorCodeName) Log(ctx *context.Context, format string, args ...interface{}) {
|
||||
func (e ErrorCodeName) Log(ctx *context.Context, format string, args ...any) {
|
||||
if SkipCanceled {
|
||||
if ctx.IsCanceled() {
|
||||
return
|
||||
@@ -471,7 +471,7 @@ type Error struct {
|
||||
ErrorCode ErrorCode `json:"http_error_code" yaml:"HTTPErrorCode"`
|
||||
Message string `json:"message,omitempty" yaml:"Message"`
|
||||
Details string `json:"details,omitempty" yaml:"Details"`
|
||||
Validation interface{} `json:"validation,omitempty" yaml:"Validation,omitempty"`
|
||||
Validation any `json:"validation,omitempty" yaml:"Validation,omitempty"`
|
||||
Data json.RawMessage `json:"data,omitempty" yaml:"Data,omitempty"` // any other custom json data.
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ func (err *Error) Error() string {
|
||||
return sprintf("iris http wire error: canonical name: %s, http status code: %d, message: %s, details: %s", err.ErrorCode.CanonicalName, err.ErrorCode.Status, err.Message, err.Details)
|
||||
}
|
||||
|
||||
func fail(ctx *context.Context, codeName ErrorCodeName, msg, details string, validationErrors interface{}, dataValue interface{}) {
|
||||
func fail(ctx *context.Context, codeName ErrorCodeName, msg, details string, validationErrors any, dataValue any) {
|
||||
errorCode, ok := errorCodeMap[codeName]
|
||||
if !ok {
|
||||
// This SHOULD NEVER happen, all ErrorCodeNames MUST be registered.
|
||||
|
||||
@@ -64,7 +64,7 @@ func Handle(ctx *context.Context, resp any, err error) bool {
|
||||
}
|
||||
|
||||
// checkNaN checks if any exported field in the struct is NaN and returns an error if it is.
|
||||
func checkNaN(v interface{}) error {
|
||||
func checkNaN(v any) error {
|
||||
val := reflect.ValueOf(v)
|
||||
return checkNaNRecursive(val, val.Type().Name())
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ type ValidationError interface {
|
||||
error
|
||||
|
||||
GetField() string
|
||||
GetValue() interface{}
|
||||
GetValue() any
|
||||
GetReason() string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user