feat(error): more error handling
added missing checks
This commit is contained in:
parent
146315f991
commit
d6cbea3f58
@ -33,6 +33,14 @@ func CreateTagGroup(ctx context.Context, tagGroupName models.TagGroupName, tagNa
|
||||
return models.TagGroup{}, utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
|
||||
}
|
||||
|
||||
if tagGroupName == "" {
|
||||
return models.TagGroup{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.TagGroupNameIsEmpty})
|
||||
}
|
||||
|
||||
if tagName == "" {
|
||||
return models.TagGroup{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.TagNameIsEmpty})
|
||||
}
|
||||
|
||||
tagGroup := models.TagGroup{
|
||||
Name: tagGroupName,
|
||||
TagID: tagName,
|
||||
|
Loading…
Reference in New Issue
Block a user