aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-14 14:30:50 +0200
committerJakob Unterwurzacher2017-05-14 14:30:50 +0200
commitc44389d9422f31e0b462d1bcd47f80e95913cb60 (patch)
tree367e361b99e10a565674bfeb510602af60637920 /main.go
parent2aea2d3d62e5df4c8bf25195dc97e60b495f6f12 (diff)
exitcodes: specific codes for failure to read or write gocryptfs.conf
New codes: * OpenConf = 23 * WriteConf = 24
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.go b/main.go
index 27cbf1f..77d25f4 100644
--- a/main.go
+++ b/main.go
@@ -52,7 +52,7 @@ func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.Conf
fd, err := os.Open(args.config)
if err != nil {
tlog.Fatal.Printf("Cannot open config file: %v", err)
- return nil, nil, err
+ return nil, nil, exitcodes.NewErr(err.Error(), exitcodes.OpenConf)
}
fd.Close()
// The user has passed the master key (probably because he forgot the
@@ -97,7 +97,7 @@ func changePassword(args *argContainer) {
err = confFile.WriteFile()
if err != nil {
tlog.Fatal.Println(err)
- os.Exit(exitcodes.Init)
+ os.Exit(exitcodes.WriteConf)
}
tlog.Info.Printf(tlog.ColorGreen + "Password changed." + tlog.ColorReset)
os.Exit(0)