mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:47:33 +00:00
refactor: rename package errors to zerrors (#7039)
* chore: rename package errors to zerrors * rename package errors to gerrors * fix error related linting issues * fix zitadel error assertion * fix gosimple linting issues * fix deprecated linting issues * resolve gci linting issues * fix import structure --------- Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
@@ -4,8 +4,8 @@ import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
|
||||
// SearchQuery defines the which and how data are queried
|
||||
@@ -99,16 +99,16 @@ func NewFilter(field Field, value interface{}, operation Operation) *Filter {
|
||||
// Validate checks if the fields of the filter have valid values
|
||||
func (f *Filter) Validate() error {
|
||||
if f == nil {
|
||||
return errors.ThrowPreconditionFailed(nil, "REPO-z6KcG", "filter is nil")
|
||||
return zerrors.ThrowPreconditionFailed(nil, "REPO-z6KcG", "filter is nil")
|
||||
}
|
||||
if f.Field <= 0 || f.Field >= fieldCount {
|
||||
return errors.ThrowPreconditionFailed(nil, "REPO-zw62U", "field not definded")
|
||||
return zerrors.ThrowPreconditionFailed(nil, "REPO-zw62U", "field not definded")
|
||||
}
|
||||
if f.Value == nil {
|
||||
return errors.ThrowPreconditionFailed(nil, "REPO-GJ9ct", "no value definded")
|
||||
return zerrors.ThrowPreconditionFailed(nil, "REPO-GJ9ct", "no value definded")
|
||||
}
|
||||
if f.Operation <= 0 || f.Operation >= operationCount {
|
||||
return errors.ThrowPreconditionFailed(nil, "REPO-RrQTy", "operation not definded")
|
||||
return zerrors.ThrowPreconditionFailed(nil, "REPO-RrQTy", "operation not definded")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func (f *Filter) Validate() error {
|
||||
func QueryFromBuilder(builder *eventstore.SearchQueryBuilder) (*SearchQuery, error) {
|
||||
if builder == nil ||
|
||||
builder.GetColumns().Validate() != nil {
|
||||
return nil, errors.ThrowPreconditionFailed(nil, "MODEL-4m9gs", "builder invalid")
|
||||
return nil, zerrors.ThrowPreconditionFailed(nil, "MODEL-4m9gs", "builder invalid")
|
||||
}
|
||||
|
||||
query := &SearchQuery{
|
||||
|
Reference in New Issue
Block a user