From 9ac6983e458d7d578acdc755029c3d82978c1584 Mon Sep 17 00:00:00 2001 From: Atanas Dinov Date: Fri, 17 Nov 2023 17:21:31 +0200 Subject: [PATCH] Use more verbose error wrapping Signed-off-by: Atanas Dinov --- pkg/build/grub.go | 2 +- pkg/build/raw.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/build/grub.go b/pkg/build/grub.go index eb857517..f0da90d5 100644 --- a/pkg/build/grub.go +++ b/pkg/build/grub.go @@ -28,7 +28,7 @@ func (b *Builder) generateGRUBGuestfishCommands() (string, error) { snippet, err := template.Parse("guestfish-snippet", guestfishSnippet, values) if err != nil { - return "", fmt.Errorf("parsing guestfish template: %w", err) + return "", fmt.Errorf("parsing GRUB guestfish snippet: %w", err) } return snippet, nil diff --git a/pkg/build/raw.go b/pkg/build/raw.go index 0ae3c338..837c8dfd 100644 --- a/pkg/build/raw.go +++ b/pkg/build/raw.go @@ -70,12 +70,12 @@ func (b *Builder) writeModifyScript() error { data, err := template.Parse(modifyScriptName, modifyRawImageTemplate, &values) if err != nil { - return fmt.Errorf("parsing template: %w", err) + return fmt.Errorf("parsing %s template: %w", modifyScriptName, err) } filename := b.generateBuildDirFilename(modifyScriptName) if err = os.WriteFile(filename, []byte(data), fileio.ExecutablePerms); err != nil { - return fmt.Errorf("writing modification script: %w", err) + return fmt.Errorf("writing modification script %s: %w", modifyScriptName, err) } return nil