From a78ece4ac2b7cabe440c12f712021cfa0dfbf298 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 15 Apr 2016 14:09:42 -0700 Subject: [PATCH] etcdctl: snapshot status error for non-existent file --- etcdctl/ctlv3/command/snapshot_command.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etcdctl/ctlv3/command/snapshot_command.go b/etcdctl/ctlv3/command/snapshot_command.go index b55df8095..586344384 100644 --- a/etcdctl/ctlv3/command/snapshot_command.go +++ b/etcdctl/ctlv3/command/snapshot_command.go @@ -297,6 +297,10 @@ type dbstatus struct { } func dbStatus(p string) dbstatus { + if _, err := os.Stat(p); err != nil { + ExitWithError(ExitError, err) + } + ds := dbstatus{} db, err := bolt.Open(p, 0600, nil)