more verbose errors

This commit is contained in:
Darko Luketic 2024-01-08 16:45:09 +01:00
parent 0b1f545aa5
commit 2175b22f2a

View File

@ -41,14 +41,14 @@ func (r *Runner) Run() error {
if v != fv { if v != fv {
l, e := goBuildBinary(m.RootPath) l, e := goBuildBinary(m.RootPath)
if e != nil { if e != nil {
return e return fmt.Errorf("error in goBuildBinary: %s", e)
} }
_, e = r.client.Logentry. _, e = r.client.Logentry.
Create(). Create().
SetContent(l). SetContent(l).
Save(context.Background()) Save(context.Background())
if e != nil { if e != nil {
return e return fmt.Errorf("error creating log entry: %s", e)
} }
if m.MoveToTarget { if m.MoveToTarget {
if fl, e := copyFile( if fl, e := copyFile(
@ -62,12 +62,12 @@ func (r *Runner) Run() error {
SetContent(fl). SetContent(fl).
Save(context.Background()) Save(context.Background())
if e != nil { if e != nil {
return e return fmt.Errorf("error saving log entry: %s", e)
} }
} }
} else { } else {
if e := chownBinary(m.User, m.Group, fmt.Sprintf("%s/%s", m.RootPath, m.BinaryPath)); e != nil { if e := chownBinary(m.User, m.Group, fmt.Sprintf("%s/%s", m.RootPath, m.BinaryPath)); e != nil {
return e return fmt.Errorf("error chowning binary: %s", e)
} }
} }