diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-06-04 18:43:51 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-06-04 18:43:51 +0300 |
commit | b3b7b7048083af8da9cc6e78e1a4cb73988f6798 (patch) | |
tree | c51038525a52b0d820c4f7a4aac1c0044404ef07 /matrix/crypto.go | |
parent | 996fe62a21df9e7f724cc614ecbfba9a6844ebef (diff) |
Improve errors in crypto stuff
Diffstat (limited to 'matrix/crypto.go')
-rw-r--r-- | matrix/crypto.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/matrix/crypto.go b/matrix/crypto.go index 8eab355..158a1f2 100644 --- a/matrix/crypto.go +++ b/matrix/crypto.go @@ -21,6 +21,8 @@ package matrix import ( "path/filepath" + "github.com/pkg/errors" + "maunium.net/go/mautrix/crypto" "maunium.net/go/gomuks/debug" @@ -51,12 +53,12 @@ func isBadEncryptError(err error) bool { func (c *Container) initCrypto() error { cryptoStore, err := crypto.NewGobStore(filepath.Join(c.config.DataDir, "crypto.gob")) if err != nil { - return err + return errors.Wrap(err, "failed to open crypto store") } c.crypto = crypto.NewOlmMachine(c.client, cryptoLogger{}, cryptoStore, c.config.Rooms) err = c.crypto.Load() if err != nil { - return err + return errors.Wrap(err, "failed to create olm machine") } return nil } |