feat: translate error messages (#254)

* feat: translate error messages in error interceptor

* fix: add statik import

* feat: user error msgs

* feat: add translations

* feat: add translations

* feat: add translations

* feat: add translations

* feat: add translations

* feat: add translations

* some fixes and improved error messages

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2020-06-22 13:51:44 +02:00
committed by GitHub
parent f68a5e63b5
commit 6556d053b2
52 changed files with 570 additions and 389 deletions

View File

@@ -17,7 +17,7 @@ func PasswordAgePolicyQuery(recourceOwner string, latestSequence uint64) *es_mod
func PasswordAgePolicyAggregate(ctx context.Context, aggCreator *es_models.AggregateCreator, policy *PasswordAgePolicy) (*es_models.Aggregate, error) {
if policy == nil {
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-1T05i", "existing policy should not be nil")
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-1T05i", "Errors.Internal")
}
return aggCreator.NewAggregate(ctx, policy.AggregateID, model.PasswordAgePolicyAggregate, policyAgeVersion, policy.Sequence)
}
@@ -25,7 +25,7 @@ func PasswordAgePolicyAggregate(ctx context.Context, aggCreator *es_models.Aggre
func PasswordAgePolicyCreateAggregate(aggCreator *es_models.AggregateCreator, policy *PasswordAgePolicy) func(ctx context.Context) (*es_models.Aggregate, error) {
return func(ctx context.Context) (*es_models.Aggregate, error) {
if policy == nil {
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-kdie6", "policy should not be nil")
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-kdie6", "Errors.Internal")
}
agg, err := PasswordAgePolicyAggregate(ctx, aggCreator, policy)
if err != nil {
@@ -39,7 +39,7 @@ func PasswordAgePolicyCreateAggregate(aggCreator *es_models.AggregateCreator, po
func PasswordAgePolicyUpdateAggregate(aggCreator *es_models.AggregateCreator, existing *PasswordAgePolicy, new *PasswordAgePolicy) func(ctx context.Context) (*es_models.Aggregate, error) {
return func(ctx context.Context) (*es_models.Aggregate, error) {
if new == nil {
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-dhr74", "new policy should not be nil")
return nil, errors.ThrowPreconditionFailed(nil, "EVENT-dhr74", "Errors.Internal")
}
agg, err := PasswordAgePolicyAggregate(ctx, aggCreator, existing)
if err != nil {