backup: return normal error if --group-by cannot be parsed

Co-authored-by: greatroar <61184462+greatroar@users.noreply.github.com>
This commit is contained in:
Michael Eischer 2023-05-13 22:34:02 +02:00
parent f9850b79b5
commit a013014c24

View file

@ -2,10 +2,9 @@ package restic
import ( import (
"encoding/json" "encoding/json"
"fmt"
"sort" "sort"
"strings" "strings"
"github.com/restic/restic/internal/errors"
) )
type SnapshotGroupByOptions struct { type SnapshotGroupByOptions struct {
@ -26,7 +25,7 @@ func splitSnapshotGroupBy(s string) (SnapshotGroupByOptions, error) {
l.Tag = true l.Tag = true
case "": case "":
default: default:
return SnapshotGroupByOptions{}, errors.Fatal("unknown grouping option: '" + option + "'") return SnapshotGroupByOptions{}, fmt.Errorf("unknown grouping option: %q", option)
} }
} }
return l, nil return l, nil