mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +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,11 +4,11 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
caos_errs "github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/notification/channels/fs"
|
||||
iam_repo "github.com/zitadel/zitadel/internal/repository/instance"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
|
||||
func (c *Commands) AddDebugNotificationProviderFile(ctx context.Context, fileSystemProvider *fs.Config) (*domain.ObjectDetails, error) {
|
||||
@@ -35,7 +35,7 @@ func (c *Commands) addDefaultDebugNotificationFile(ctx context.Context, instance
|
||||
return nil, err
|
||||
}
|
||||
if addedWriteModel.State.Exists() {
|
||||
return nil, caos_errs.ThrowAlreadyExists(nil, "INSTANCE-d93nfs", "Errors.IAM.DebugNotificationProvider.AlreadyExists")
|
||||
return nil, zerrors.ThrowAlreadyExists(nil, "INSTANCE-d93nfs", "Errors.IAM.DebugNotificationProvider.AlreadyExists")
|
||||
}
|
||||
|
||||
events := []eventstore.Command{
|
||||
@@ -70,7 +70,7 @@ func (c *Commands) changeDefaultDebugNotificationProviderFile(ctx context.Contex
|
||||
return nil, err
|
||||
}
|
||||
if !existingProvider.State.Exists() {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-fm9wl", "Errors.IAM.DebugNotificationProvider.NotFound")
|
||||
return nil, zerrors.ThrowNotFound(nil, "INSTANCE-fm9wl", "Errors.IAM.DebugNotificationProvider.NotFound")
|
||||
}
|
||||
events := make([]eventstore.Command, 0)
|
||||
changedEvent, hasChanged := existingProvider.NewChangedEvent(ctx,
|
||||
@@ -80,7 +80,7 @@ func (c *Commands) changeDefaultDebugNotificationProviderFile(ctx context.Contex
|
||||
events = append(events, changedEvent)
|
||||
}
|
||||
if len(events) == 0 {
|
||||
return nil, caos_errs.ThrowPreconditionFailed(nil, "INSTANCE-5M9vdd", "Errors.IAM.LoginPolicy.NotChanged")
|
||||
return nil, zerrors.ThrowPreconditionFailed(nil, "INSTANCE-5M9vdd", "Errors.IAM.LoginPolicy.NotChanged")
|
||||
|
||||
}
|
||||
return events, nil
|
||||
@@ -94,7 +94,7 @@ func (c *Commands) RemoveDefaultNotificationFile(ctx context.Context) (*domain.O
|
||||
return nil, err
|
||||
}
|
||||
if !existingProvider.State.Exists() {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "INSTANCE-dj9ew", "Errors.IAM.DebugNotificationProvider.NotFound")
|
||||
return nil, zerrors.ThrowNotFound(nil, "INSTANCE-dj9ew", "Errors.IAM.DebugNotificationProvider.NotFound")
|
||||
}
|
||||
|
||||
events, err := c.eventstore.Push(ctx, iam_repo.NewDebugNotificationProviderFileRemovedEvent(ctx, instanceAgg))
|
||||
|
Reference in New Issue
Block a user