@@ -12,6 +12,7 @@ import (
1212 "strings"
1313
1414 "github.com/azure/azure-dev/cli/azd/cmd/actions"
15+ "github.com/azure/azure-dev/cli/azd/internal"
1516 "github.com/azure/azure-dev/cli/azd/pkg/account"
1617 "github.com/azure/azure-dev/cli/azd/pkg/config"
1718 "github.com/azure/azure-dev/cli/azd/pkg/input"
@@ -83,8 +84,8 @@ func (a *subFilterSetAction) Run(
8384) (* actions.ActionResult , error ) {
8485 if a .console .IsNoPromptMode () {
8586 return nil , fmt .Errorf (
86- "subscription filter set requires interactive mode" +
87- " (cannot run with --no-prompt)" ,
87+ "subscription filter set requires interactive mode (cannot run with --no-prompt): %w" ,
88+ internal . ErrInteractiveRequired ,
8889 )
8990 }
9091
@@ -105,7 +106,10 @@ func (a *subFilterSetAction) Run(
105106 }
106107
107108 if len (subscriptions ) == 0 {
108- return nil , fmt .Errorf ("no subscriptions found" )
109+ return nil , fmt .Errorf (
110+ "no subscriptions found: %w" ,
111+ internal .ErrNoSubscriptionsFound ,
112+ )
109113 }
110114
111115 // Resolve tenant
@@ -122,7 +126,8 @@ func (a *subFilterSetAction) Run(
122126 )
123127 if len (tenantSubs ) == 0 {
124128 return nil , fmt .Errorf (
125- "no subscriptions found for tenant %s" , tenantId ,
129+ "no subscriptions found for tenant %s: %w" ,
130+ tenantId , internal .ErrNoSubscriptionsFound ,
126131 )
127132 }
128133
@@ -280,8 +285,8 @@ func (a *subFilterRemoveAction) Run(
280285) (* actions.ActionResult , error ) {
281286 if a .console .IsNoPromptMode () {
282287 return nil , fmt .Errorf (
283- "subscription filter remove requires interactive mode" +
284- " (cannot run with --no-prompt)" ,
288+ "subscription filter remove requires interactive mode (cannot run with --no-prompt): %w" ,
289+ internal . ErrInteractiveRequired ,
285290 )
286291 }
287292
@@ -302,7 +307,10 @@ func (a *subFilterRemoveAction) Run(
302307 }
303308
304309 if len (subscriptions ) == 0 {
305- return nil , fmt .Errorf ("no subscriptions found" )
310+ return nil , fmt .Errorf (
311+ "no subscriptions found: %w" ,
312+ internal .ErrNoSubscriptionsFound ,
313+ )
306314 }
307315
308316 // Resolve tenant
@@ -401,7 +409,9 @@ func resolveTenantForFilter(
401409 // API call when only a single tenant exists.
402410 tenants := prompt .ExtractUniqueTenants (subscriptions , nil )
403411 if len (tenants ) == 0 {
404- return "" , "" , fmt .Errorf ("no tenants found" )
412+ return "" , "" , fmt .Errorf (
413+ "no tenants found: %w" , internal .ErrNoTenantsFound ,
414+ )
405415 }
406416
407417 if len (tenants ) == 1 {
0 commit comments