nametransform, main: better error messages
This commit is contained in:
parent
4c5365d161
commit
80b027f830
@ -37,7 +37,8 @@ func ReadDirIV(dir string) (iv []byte, err error) {
|
||||
func ReadDirIVAt(dirfd *os.File) (iv []byte, err error) {
|
||||
fdRaw, err := syscall.Openat(int(dirfd.Fd()), DirIVFilename, syscall.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
toggledlog.Warn.Printf("ReadDirIVAt: %v", err)
|
||||
toggledlog.Warn.Printf("ReadDirIVAt: opening %q in dir %q failed: %v",
|
||||
DirIVFilename, dirfd.Name(), err)
|
||||
return nil, err
|
||||
}
|
||||
fd := os.NewFile(uintptr(fdRaw), DirIVFilename)
|
||||
@ -46,7 +47,7 @@ func ReadDirIVAt(dirfd *os.File) (iv []byte, err error) {
|
||||
iv = make([]byte, dirIVLen+1)
|
||||
n, err := fd.Read(iv)
|
||||
if err != nil {
|
||||
toggledlog.Warn.Printf("ReadDirIVAt: %v", err)
|
||||
toggledlog.Warn.Printf("ReadDirIVAt: Read failed: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
iv = iv[0:n]
|
||||
|
2
main.go
2
main.go
@ -101,7 +101,7 @@ func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.Conf
|
||||
// Check if the file exists at all before prompting for a password
|
||||
_, err := os.Stat(args.config)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Printf(colorRed+"Config file not found: %v\n"+colorReset, err)
|
||||
os.Exit(ERREXIT_LOADCONF)
|
||||
}
|
||||
if args.extpass == "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user