fix: correct error messages for policy queries (#8722)

# Which Problems Are Solved

Errors messages are mixed up for some policies

# How the Problems Are Solved

Define new error IDs and correct the messages.

# Additional Changes

None

# Additional Context

None
This commit is contained in:
Stefan Benz 2024-10-03 17:53:03 +02:00 committed by GitHub
parent c0615e95e2
commit 5e57d3bebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -173,9 +173,9 @@ func prepareLockoutPolicyQuery(ctx context.Context, db prepareDatabase) (sq.Sele
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-63mtI", "Errors.PasswordComplexityPolicy.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-38pZnUemLP", "Errors.IAM.PasswordLockoutPolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-uulCZ", "Errors.Internal")
return nil, zerrors.ThrowInternal(err, "QUERY-PJURxRUoYG", "Errors.Internal")
}
return policy, nil
}

View File

@ -176,9 +176,9 @@ func preparePasswordAgePolicyQuery(ctx context.Context, db prepareDatabase) (sq.
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-63mtI", "Errors.Org.PasswordComplexity.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-ShCWRnWJfH", "Errors.IAM.PasswordAgePolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-uulCZ", "Errors.Internal")
return nil, zerrors.ThrowInternal(err, "QUERY-6nj7Bm4fxT", "Errors.Internal")
}
return policy, nil
}

View File

@ -198,9 +198,9 @@ func preparePasswordComplexityPolicyQuery(ctx context.Context, db prepareDatabas
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, zerrors.ThrowNotFound(err, "QUERY-63mtI", "Errors.PasswordComplexity.NotFound")
return nil, zerrors.ThrowNotFound(err, "QUERY-hgA9vuM0qg", "Errors.IAM.PasswordComplexityPolicy.NotFound")
}
return nil, zerrors.ThrowInternal(err, "QUERY-uulCZ", "Errors.Internal")
return nil, zerrors.ThrowInternal(err, "QUERY-TvvW9Uij7M", "Errors.Internal")
}
return policy, nil
}