Skip to content

Commit

Permalink
fix: report error if selections are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Saidl committed Oct 3, 2024
1 parent b657844 commit 74b885f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.0.27] - 2024-10-03

### Fixed
- report error if selections are empty

## [v1.0.26] - 2024-09-10

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/uxHelpers/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func PrintOrgSelector(

if len(orgs) == 0 {
uxBlocks.PrintWarning(styles.WarningLine(i18n.T(i18n.OrgSelectorListEmpty)))
return nil, nil
return nil, errors.New(i18n.T(i18n.OrgSelectorListEmpty))
}

header, tableBody := createOrgTableRows(orgs)
Expand Down
2 changes: 1 addition & 1 deletion src/uxHelpers/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func PrintProjectSelector(

if len(projects) == 0 {
uxBlocks.PrintWarning(styles.WarningLine(i18n.T(i18n.ProjectSelectorListEmpty)))
return nil, nil
return nil, errors.New(i18n.T(i18n.OrgSelectorListEmpty))
}

header, tableBody := createProjectTableRows(projects)
Expand Down
2 changes: 1 addition & 1 deletion src/uxHelpers/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func PrintServiceSelector(

if len(services) == 0 {
uxBlocks.PrintWarning(styles.WarningLine(i18n.T(i18n.ServiceSelectorListEmpty)))
return nil, nil
return nil, errors.New(i18n.T(i18n.ServiceSelectorListEmpty))
}

header, rows := createServiceTableRows(services)
Expand Down

0 comments on commit 74b885f

Please sign in to comment.