Skip to content

Commit 70ff7cd

Browse files
hvn2k1cre8ivejp
authored andcommitted
Fix lint and unit test
1 parent 5f6db43 commit 70ff7cd

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

pkg/domainevent/domain/message.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,14 @@ func LocalizedMessage(eventType proto.Event_Type, localizer locale.Localizer) *p
13111311
localizer.MustLocalizeWithTemplate(locale.Organization),
13121312
),
13131313
}
1314+
case proto.Event_DEMO_ORGANIZATION_CREATED:
1315+
return &proto.LocalizedMessage{
1316+
Locale: localizer.GetLocale(),
1317+
Message: localizer.MustLocalizeWithTemplate(
1318+
locale.CreatedTemplate,
1319+
localizer.MustLocalizeWithTemplate(locale.Organization),
1320+
),
1321+
}
13141322
case proto.Event_ORGANIZATION_NAME_CHANGED:
13151323
return &proto.LocalizedMessage{
13161324
Locale: localizer.GetLocale(),

pkg/environment/api/organization.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,19 @@ func (s *EnvironmentService) createOrganizationMySQL(
582582
isTrial,
583583
isSystemAdmin,
584584
)
585+
if err != nil {
586+
s.logger.Error(
587+
"Failed to create a domain organization",
588+
log.FieldsFromImcomingContext(ctx).AddFields(zap.Error(err))...)
589+
dt, err := statusInternal.WithDetails(&errdetails.LocalizedMessage{
590+
Locale: localizer.GetLocale(),
591+
Message: localizer.MustLocalize(locale.InternalServerError),
592+
})
593+
if err != nil {
594+
return nil, statusInternal.Err()
595+
}
596+
return nil, dt.Err()
597+
}
585598
var envRoles []*accountproto.AccountV2_EnvironmentRole
586599
err = s.mysqlClient.RunInTransactionV2(ctx, func(contextWithTx context.Context, _ mysql.Transaction) error {
587600
// Check if there is already a system admin organization

0 commit comments

Comments
 (0)