Skip to content

Commit 7663db9

Browse files
authored
Merge 5e29ffc into ab0f33f
2 parents ab0f33f + 5e29ffc commit 7663db9

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ require (
7474
github.com/spf13/pflag v1.0.9
7575
github.com/spf13/viper v1.20.1
7676
github.com/stretchr/testify v1.11.1
77-
github.com/superfly/fly-go v0.1.54
77+
github.com/superfly/fly-go v0.1.55-0.20250930234843-3142f94c5f3e
7878
github.com/superfly/graphql v0.2.6
7979
github.com/superfly/lfsc-go v0.1.1
8080
github.com/superfly/macaroon v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
635635
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
636636
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
637637
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
638-
github.com/superfly/fly-go v0.1.54 h1:O6SUkihongJJeGF2nr+LuN426LnMPxewRdQArv/xGOM=
639-
github.com/superfly/fly-go v0.1.54/go.mod h1:YcVyr0bQm6cdydoMsqIHDPZDQqbmErwCSIuJI4pNwZM=
638+
github.com/superfly/fly-go v0.1.55-0.20250930234843-3142f94c5f3e h1:+0VfB8XizK+8yw6U9gzOa+n2As/E8TKy1fNB/rB8Wm4=
639+
github.com/superfly/fly-go v0.1.55-0.20250930234843-3142f94c5f3e/go.mod h1:OEtmZnkQLEUNGyW+vzq52VnB8mMnTgsiHGdNfYd7IkM=
640640
github.com/superfly/graphql v0.2.6 h1:zppbodNerWecoXEdjkhrqaNaSjGqobhXNlViHFuZzb4=
641641
github.com/superfly/graphql v0.2.6/go.mod h1:CVfDl31srm8HnJ9udwLu6hFNUW/P6GUM2dKcG1YQ8jc=
642642
github.com/superfly/lfsc-go v0.1.1 h1:dGjLgt81D09cG+aR9lJZIdmonjZSR5zYCi7s54+ZU2Q=

internal/command/deploy/machines_deploymachinesapp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (md *machineDeployment) DeployMachinesApp(ctx context.Context) error {
6060
}
6161
fullOrg, err := md.apiClient.GetOrganizationBySlug(ctx, md.app.Organization.Slug)
6262
if err != nil {
63-
return err
63+
return fmt.Errorf("failed to ger org for deployment: %w", err)
6464
}
6565

6666
md.tigrisStatics = statics.Deployer(md.appConfig, fullApp, fullOrg, md.releaseVersion)

internal/command/launch/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func run(ctx context.Context) (err error) {
459459

460460
err = state.Launch(ctx)
461461
if err != nil {
462-
return err
462+
return fmt.Errorf("failed to launch %+v: %w", state.Plan, err)
463463
}
464464

465465
if flag.GetBool(ctx, "attach") && parentConfig != nil && !flag.GetBool(ctx, "no-create") {

internal/command/launch/launch.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (state *launchState) Launch(ctx context.Context) error {
4242

4343
org, err := state.Org(ctx)
4444
if err != nil {
45-
return err
45+
return fmt.Errorf("failed to get org for launch: %w", err)
4646
}
4747
if !planValidateHighAvailability(ctx, state.Plan, org, !state.warnedNoCcHa) {
4848
state.Plan.HighAvailability = false
@@ -334,7 +334,8 @@ func (state *launchState) createApp(ctx context.Context) (flapsutil.FlapsClient,
334334
apiClient := flyutil.ClientFromContext(ctx)
335335
org, err := state.Org(ctx)
336336
if err != nil {
337-
return nil, nil, err
337+
return nil, nil, fmt.Errorf("failed to get org for app: %w", err)
338+
338339
}
339340
app, err := apiClient.CreateApp(ctx, fly.CreateAppInput{
340341
OrganizationID: org.ID,

internal/command/launch/state.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ func cacheGrab[T any](cache map[string]interface{}, key string, cb func() (T, er
5959
func (state *launchState) Org(ctx context.Context) (*fly.Organization, error) {
6060
apiClient := flyutil.ClientFromContext(ctx)
6161
return cacheGrab(state.cache, "org,"+state.Plan.OrgSlug, func() (*fly.Organization, error) {
62-
return apiClient.GetOrganizationBySlug(ctx, state.Plan.OrgSlug)
62+
org, err := apiClient.GetOrganizationBySlug(ctx, state.Plan.OrgSlug)
63+
if err != nil {
64+
return nil, fmt.Errorf("failed to get org %q for state: %w", state.Plan.OrgSlug, err)
65+
}
66+
return org, nil
6367
})
6468
}
6569

0 commit comments

Comments
 (0)