From 982f9e0b5cc1c77b918b959879f0a0f83c9793ab Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Mon, 6 Dec 2021 12:13:18 +0100 Subject: [PATCH] better error handling --- cmd/backup.go | 2 +- internal/location.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/backup.go b/cmd/backup.go index 38d3fe1..a575220 100644 --- a/cmd/backup.go +++ b/cmd/backup.go @@ -31,7 +31,7 @@ var backupCmd = &cobra.Command{ location, _ := internal.GetLocation(splitted[0]) errs := location.Backup(false, specificBackend) for _, err := range errs { - colors.Error.Println(err) + colors.Error.Printf("%s\n\n", err) errors++ } } diff --git a/internal/location.go b/internal/location.go index 2b2e4a3..b94b916 100644 --- a/internal/location.go +++ b/internal/location.go @@ -216,7 +216,8 @@ func (l Location) Backup(cron bool, specificBackend string) []error { out, err = backend.ExecDocker(l, cmd) } if err != nil { - errors = append(errors, err) + colors.Error.Println(out) + errors = append(errors, fmt.Errorf("%s@%s:\n%s%s", l.name, backend.name, out, err)) continue }