whisper/mailserver: add returns to fmt.Errorf

This commit is contained in:
Ivan Danyliuk 2018-05-04 10:23:23 +02:00
parent af6c245103
commit b928abcaa9
No known key found for this signature in database
GPG key ID: 97ED33CE024E1DBF

View file

@ -60,12 +60,12 @@ func (s *WMailServer) Init(shh *whisper.Whisper, path string, password string, p
}
if len(password) == 0 {
fmt.Errorf("password is not specified")
return fmt.Errorf("password is not specified")
}
s.db, err = leveldb.OpenFile(path, nil)
if err != nil {
fmt.Errorf("open DB file: %s", err)
return fmt.Errorf("open DB file: %s", err)
}
s.w = shh
@ -73,11 +73,11 @@ func (s *WMailServer) Init(shh *whisper.Whisper, path string, password string, p
MailServerKeyID, err := s.w.AddSymKeyFromPassword(password)
if err != nil {
fmt.Errorf("create symmetric key: %s", err)
return fmt.Errorf("create symmetric key: %s", err)
}
s.key, err = s.w.GetSymKey(MailServerKeyID)
if err != nil {
fmt.Errorf("save symmetric key: %s", err)
return fmt.Errorf("save symmetric key: %s", err)
}
return nil
}