Skip to content

Commit

Permalink
Use more verbose error wrapping
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Dinov <[email protected]>
  • Loading branch information
atanasdinov committed Nov 17, 2023
1 parent 46f6a2e commit 9ac6983
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/build/grub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ac6983

Please sign in to comment.