errors/middleware.go
func GetErrorHandler(ctx context.Context, status int) ErrorHandler {
	key := fmt.Sprintf("error_handler_%d", status)
	if h, ok := ctx.Value(key).(ErrorHandler); ok {
		return h
	}

	key = fmt.Sprintf("error_handler_%d", AllStatusCodes)
	if h, ok := ctx.Value(key).(ErrorHandler); ok {
		return h
	}

	return DefaultErrorHandler
}
func GetErrorHandler(ctx context.Context, status int) ErrorHandler {
	key := fmt.Sprintf("error_handler_%d", status)
	if h, ok := ctx.Value(key).(ErrorHandler); ok {
		return h
	}

	key = fmt.Sprintf("error_handler_%d", AllStatusCodes)
	if h, ok := ctx.Value(key).(ErrorHandler); ok {
		return h
	}

	return DefaultErrorHandler
}
func GetErrorHandler ( ctx context . Context , status int ) ErrorHandler { key := fmt . Sprintf ( " " , status ) if h , ok := ctx . Value ( key ) . ( ErrorHandler ) ; ok { return h } key = fmt . Sprintf ( " " , AllStatusCodes ) if h , ok := ctx . Value ( key ) . ( ErrorHandler ) ; ok { return h } return DefaultErrorHandler }
// GetErrorHandler gets the error handler from the context or returns the default
GetErrorHandler gets the error handler from the context or returns the default