feat(error): more error handling

added missing checks
This commit is contained in:
SoXX 2024-08-13 14:25:36 +02:00
parent 146315f991
commit d6cbea3f58

View File

@ -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}) 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{ tagGroup := models.TagGroup{
Name: tagGroupName, Name: tagGroupName,
TagID: tagName, TagID: tagName,