mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
better error handling
This commit is contained in:
parent
0c37af5588
commit
982f9e0b5c
@ -31,7 +31,7 @@ var backupCmd = &cobra.Command{
|
|||||||
location, _ := internal.GetLocation(splitted[0])
|
location, _ := internal.GetLocation(splitted[0])
|
||||||
errs := location.Backup(false, specificBackend)
|
errs := location.Backup(false, specificBackend)
|
||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
colors.Error.Println(err)
|
colors.Error.Printf("%s\n\n", err)
|
||||||
errors++
|
errors++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,8 @@ func (l Location) Backup(cron bool, specificBackend string) []error {
|
|||||||
out, err = backend.ExecDocker(l, cmd)
|
out, err = backend.ExecDocker(l, cmd)
|
||||||
}
|
}
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user