Browse Source

backup: Add fatal if dest snapshot failed

Errors are currently silently swallowed
Owen Smith 11 years ago
parent
commit
9974bf0291
1 changed files with 3 additions and 1 deletions
  1. 3 1
      etcdctl/command/backup_command.go

+ 3 - 1
etcdctl/command/backup_command.go

@@ -58,7 +58,9 @@ func handleBackup(c *cli.Context) {
 	if snapshot != nil {
 		index = snapshot.Index
 		newss := snap.New(destSnap)
-		newss.SaveSnap(*snapshot)
+		if err := newss.SaveSnap(*snapshot); err != nil {
+			log.Fatal(err)
+		}
 	}
 
 	w, err := wal.OpenAtIndex(srcWAL, index)