From 40d7a394acab353bac471d954e1c0a5cbf9ce026 Mon Sep 17 00:00:00 2001 From: mlec <42201667+mlec1@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:25:33 +0100 Subject: [PATCH] fix(error): Improve error message on snapshot creation (#655) # Description ## Checklist (For exoscale contributors) * [ ] Changelog updated (under *Unreleased* block) * [ ] Testing ## Testing --- cmd/instance_snapshot_create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/instance_snapshot_create.go b/cmd/instance_snapshot_create.go index 8205fdcb..20e888d2 100644 --- a/cmd/instance_snapshot_create.go +++ b/cmd/instance_snapshot_create.go @@ -46,6 +46,9 @@ func (c *instanceSnapshotCreateCmd) cmdRun(_ *cobra.Command, _ []string) error { instance, err := globalstate.EgoscaleClient.FindInstance(ctx, c.Zone, c.Instance) if err != nil { + if errors.Is(err, exoapi.ErrNotFound) { + return fmt.Errorf("resource not found in zone %q", c.Zone) + } return err }