Support attaching existing Restic repositories
This commit is contained in:
@@ -414,7 +414,7 @@ func resticError(message string, commandErr error) error {
|
||||
case strings.Contains(lower, "wrong password") || strings.Contains(lower, "no key found"):
|
||||
return errors.New("authentication: wrong repository password. Enter the original Restic password under Edit and select Test")
|
||||
case strings.Contains(lower, "repository does not exist") || strings.Contains(lower, "is there a repository at the following location?"):
|
||||
return errors.New("repository: destination is not initialized; open Repositories and select Initialize once")
|
||||
return errors.New("repository: Am konfigurierten Ziel wurde keine Restic-config gefunden. Für ein vorhandenes Repository den exakten Repository-Ordner eintragen; nur ein wirklich neues, leeres Ziel initialisieren")
|
||||
default:
|
||||
message = strings.TrimSpace(strings.TrimPrefix(message, "Fatal:"))
|
||||
return fmt.Errorf("restic: %s: %w", message, commandErr)
|
||||
|
||||
@@ -298,6 +298,13 @@ func TestResticErrorExplainsCiphertextVerification(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResticErrorExplainsMissingExistingRepositoryPath(t *testing.T) {
|
||||
err := resticError("Fatal: repository does not exist", fmt.Errorf("exit status 10"))
|
||||
if !strings.Contains(err.Error(), "exakten Repository-Ordner") || !strings.Contains(err.Error(), "wirklich neues") {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunnerPausesResumesAndCancelsProcessGroup(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
ticksPath := filepath.Join(dir, "ticks")
|
||||
|
||||
Reference in New Issue
Block a user